Bookmark code not working with text

G

Guest

I am trying to enable users to find information that has already been input
into the form. If there is a better way to do this, please let me know. The
code will work if I use it for numbers, but it will not work for text. I
will be looking up last names. What I am using currently is the following:

Private Sub FindLastNameCombo_AfterUpdate()

Me.Requery
FindLastNameCombo.Requery

'Move to the record selected in the control
Me.RecordsetClone.FindFirst "[MOMLAST] = " & Me![FindLastNameCombo] & ""
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub

Thanks.
 
S

Shane S via AccessMonster.com

Give this a try:

Me.RecordsetClone.FindFirst "[MOMLAST] = '" & Me![FindLastNameCombo] & "'"
'Adding spaces so you can see =' " & Me!
[FindLastNameCombo] & " ' "

HTH,
Shane

I am trying to enable users to find information that has already been input
into the form. If there is a better way to do this, please let me know. The
code will work if I use it for numbers, but it will not work for text. I
will be looking up last names. What I am using currently is the following:

Private Sub FindLastNameCombo_AfterUpdate()

Me.Requery
FindLastNameCombo.Requery

'Move to the record selected in the control
Me.RecordsetClone.FindFirst "[MOMLAST] = " & Me![FindLastNameCombo] & ""
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub

Thanks.
 
G

Guest

It worked. I really appreciate your help. Thanks.

Shane S via AccessMonster.com said:
Give this a try:

Me.RecordsetClone.FindFirst "[MOMLAST] = '" & Me![FindLastNameCombo] & "'"
'Adding spaces so you can see =' " & Me!
[FindLastNameCombo] & " ' "

HTH,
Shane

I am trying to enable users to find information that has already been input
into the form. If there is a better way to do this, please let me know. The
code will work if I use it for numbers, but it will not work for text. I
will be looking up last names. What I am using currently is the following:

Private Sub FindLastNameCombo_AfterUpdate()

Me.Requery
FindLastNameCombo.Requery

'Move to the record selected in the control
Me.RecordsetClone.FindFirst "[MOMLAST] = " & Me![FindLastNameCombo] & ""
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top