Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Me.Bookmark = rs.Bookmark

Status
Not open for further replies.

pcdaveh

Technical User
Sep 26, 2000
213
US
I have a combobox control that I'm using to select record(s) in a transactions table. The code is below. The problem is that the records in the bound controls won't change. I have this very same code in a different form and it works fine. What's up? I have exported the tables and forms into a "demo" database and zipped it up if anyone would like to look at it. I changed all my customers names to fictious ones. And I've tried using Str(Me![cmbAccount]) and had no success either.

Private Sub cmbAccount_AfterUpdate()
' Find the record that matches the control.
On Error GoTo Err_cmbAccount_AfterUpdate
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[InvIDN] = " & (Me![cmbAccount])
Me.Bookmark = rs.Bookmark

Exit_cmbAccount_AfterUpdate:
Exit Sub
Err_cmbAccount_AfterUpdate:
MsgBox Err.Description & "." & " " & Chr(10) _
& "You left the drop" & Chr(10) _
& "down list empty. " & Chr(10) & _
"Please Choose an item on the list"
cmbAccount.SetFocus
Resume Exit_cmbAccount_AfterUpdate

End Sub
 
Hi!

I'll take a look at it if you want to e-mail it to the address below.
Jeff Bridgham
bridgham@purdue.edu
 
Howdy,

If InvIDN is a string then you should use...

rs.FindFirst "[InvIDN] = """ & (Me![cmbAccount]) & """"

Another thing you can try is testing the rs.NoMatch property. This is what the help system says:

"Always check the value of the NoMatch property to determine whether the Find operation has succeeded. If the search succeeds, NoMatch is False. If it fails, NoMatch is True and the current record isn't defined. In this case, you must position the current record pointer back to a valid record."

Hope this helps.
Cheers,
Mark.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top