Moving to specific records in tblHomebuilder

  • Thread starter Thread starter T.
  • Start date Start date
T

T.

Hi everyone,

I have a form in which users can add and edit information in a table called
tblHomebuilders. When originally developed the following function displayed
the correct record for modifying ...

Private Sub cmbGetBuilder_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[Community] = '" & Me![cmbGetBuilder] & "'"
Me.Bookmark = rs.Bookmark

End Sub

Unfortunately the scale of this project has grown immensely and now it is
not functioning properly.

What I have in cmbGetBuilder is a 2 column list of values that is being
pulled from a query, [BuilderName] and [Community]. As each community can
have multiple builders and each builder can be in multipe communities I have
chosen to display them in a multi-columnar combo box.

What I need to have happen is that after a selection is made
(AfterUpdate()), all data in the form needs to go to that specific record
based on the Builder name AND Community.

I have a feeling that my code needs to change a lot to accomplish this but I
have drawn a blank and would appreciate any assistance offered.

Thanks,

T.
 
I just tried this to confirm it will work. The FindFirst statement will
accept more than one condition.

Example:

Private Sub Command6_Click()
Dim rst As DAO.Recordset
Set rst = Me.RecordsetClone
rst.FindFirst "Field1=44 And Field5=73"
Me.Bookmark = rst.Bookmark
Set rst = Nothing
End Sub
 
Thanks much for testing this out. I did figure it out late in the afternoon
yesterday. I also changed the design a bit on advice from a user so it was
a little easier then too.

Cheers,

T.
***********************************************************************
Wayne Morgan said:
I just tried this to confirm it will work. The FindFirst statement will
accept more than one condition.

Example:

Private Sub Command6_Click()
Dim rst As DAO.Recordset
Set rst = Me.RecordsetClone
rst.FindFirst "Field1=44 And Field5=73"
Me.Bookmark = rst.Bookmark
Set rst = Nothing
End Sub

--
Wayne Morgan
Microsoft Access MVP


T. said:
Hi everyone,

I have a form in which users can add and edit information in a table called
tblHomebuilders. When originally developed the following function displayed
the correct record for modifying ...

Private Sub cmbGetBuilder_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[Community] = '" & Me![cmbGetBuilder] & "'"
Me.Bookmark = rs.Bookmark

End Sub

Unfortunately the scale of this project has grown immensely and now it is
not functioning properly.

What I have in cmbGetBuilder is a 2 column list of values that is being
pulled from a query, [BuilderName] and [Community]. As each community can
have multiple builders and each builder can be in multipe communities I have
chosen to display them in a multi-columnar combo box.

What I need to have happen is that after a selection is made
(AfterUpdate()), all data in the form needs to go to that specific record
based on the Builder name AND Community.

I have a feeling that my code needs to change a lot to accomplish this
but
I
have drawn a blank and would appreciate any assistance offered.

Thanks,

T.
 
Back
Top