AshikHusein
Registered User.
- Local time
- Today, 14:13
- Joined
- Feb 7, 2003
- Messages
- 147
I am trying to use the InputBox method to retreive a particular record. The code activates on the event when the form opens. The problem is that the form does not display the correct record. Can any one figure out the problem with the code? Thanks.
Private Sub Form_Open(Cancel As Integer)
Dim rec As DAO.Recordset
Dim Count As Integer
Dim AccountNumber As String
Set rec = Me.RecordsetClone
AccountNumber = InputBox("Enter the account number to search in the format 999-9999")
rec.FindFirst "[Account Number] = " & AccountNumber
Me.Bookmark = rec.Bookmark
Exit Sub
"Account Number" is a field in the table bound to the form.
Private Sub Form_Open(Cancel As Integer)
Dim rec As DAO.Recordset
Dim Count As Integer
Dim AccountNumber As String
Set rec = Me.RecordsetClone
AccountNumber = InputBox("Enter the account number to search in the format 999-9999")
rec.FindFirst "[Account Number] = " & AccountNumber
Me.Bookmark = rec.Bookmark
Exit Sub
"Account Number" is a field in the table bound to the form.