Please need help w/Form Code

  • Thread starter Thread starter TotallyConfused
  • Start date Start date
T

TotallyConfused

I have a parameter form when I enter the data it puts the data in the first
record it finds. How can I revise this to find the record I select and save
the data to the specific records? Thank you in advance for any help you can
provide.


Private Sub cboMbr_AfterUpdate()
Dim rst As DAO.Recordset
Set rst = Me.RecordsetClone
rst.FindFirst "[ID] = '" & cboMb & "'"
If Not rst.NoMatch Then
Me.Bookmark = rst.Bookmark
End If

End Sub
 
Thank you for responding. The controls I enter the data in the parameter
form are bound. Can you help? thank you.

Steve Sanford said:
Are the controls that you enter data into bound or unbound?

--
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)


TotallyConfused said:
I have a parameter form when I enter the data it puts the data in the first
record it finds. How can I revise this to find the record I select and save
the data to the specific records? Thank you in advance for any help you can
provide.


Private Sub cboMbr_AfterUpdate()
Dim rst As DAO.Recordset
Set rst = Me.RecordsetClone
rst.FindFirst "[ID] = '" & cboMb & "'"
If Not rst.NoMatch Then
Me.Bookmark = rst.Bookmark
End If

End Sub
 
I've been trying to understand what you are tring to do.

To find one record, there needs to be a way to uniquely identify a specific
record. Is [ID] a primary key or is there a way to identify a specific
record? For example, if [ID] is the primary key and the data type is
AutoNumber, then you can pick one record out of hundreds. But if there are
say 5 records where [ID] = 123, then how would you pick a specific record?

Can you give more detail? Maybe the SQL of the recordsource for the form,
any code, where the parameters are, names, ...


--
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)


TotallyConfused said:
Thank you for responding. The controls I enter the data in the parameter
form are bound. Can you help? thank you.

Steve Sanford said:
Are the controls that you enter data into bound or unbound?

--
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)


TotallyConfused said:
I have a parameter form when I enter the data it puts the data in the first
record it finds. How can I revise this to find the record I select and save
the data to the specific records? Thank you in advance for any help you can
provide.


Private Sub cboMbr_AfterUpdate()
Dim rst As DAO.Recordset
Set rst = Me.RecordsetClone
rst.FindFirst "[ID] = '" & cboMb & "'"
If Not rst.NoMatch Then
Me.Bookmark = rst.Bookmark
End If

End Sub
 
Back
Top