Larsporsenna
Registered User.
- Local time
- Yesterday, 17:25
- Joined
- Aug 20, 2013
- Messages
- 17
I have 2 tables ASSETS and GENERAL PRACTICES and 2 corresponding Forms. In the Assets Form I have set up a text box and used a command button to let the user search for a particular Asset. The code I used for the on click event was
Private Sub SearchBox_Click()
Dim strSearch As String
On Error GoTo errHandler
strSearch = "Asset_Id = " & Chr(39) & Me!Text67.Value & Chr(39)
Me.RecordsetClone.FindFirst strSearch
Me.Bookmark = Me.RecordsetClone.Bookmark
Exit Sub
errHandler:
MsgBox "Error No: " & Err.Number & "; Description: " & _
Err.Description
End Sub
This works fine and when I click I find the correct Asset. I have used the same technique on the GP Form but when I click on the search Button I get the error message “Error No 30077 Description Syntax Error (Missing operator) in expression.
I copied the code and edited to suit the different names
Private Sub Find_Practice_Click()
Dim strSearch As String
On Error GoTo errHandler
strSearch = "Practice Code Regional = " & Chr(39) & Me!Text5.Value & Chr(39)
Me.RecordsetClone.FindFirst strSearch
Me.Bookmark = Me.RecordsetClone.Bookmark
Exit Sub
errHandler:
MsgBox "Error No: " & Err.Number & "; Description: " & _
Err.Description
End Sub
I can’t see what I am doing differently. Can anyone help? I am using Acess 2007
Private Sub SearchBox_Click()
Dim strSearch As String
On Error GoTo errHandler
strSearch = "Asset_Id = " & Chr(39) & Me!Text67.Value & Chr(39)
Me.RecordsetClone.FindFirst strSearch
Me.Bookmark = Me.RecordsetClone.Bookmark
Exit Sub
errHandler:
MsgBox "Error No: " & Err.Number & "; Description: " & _
Err.Description
End Sub
This works fine and when I click I find the correct Asset. I have used the same technique on the GP Form but when I click on the search Button I get the error message “Error No 30077 Description Syntax Error (Missing operator) in expression.
I copied the code and edited to suit the different names
Private Sub Find_Practice_Click()
Dim strSearch As String
On Error GoTo errHandler
strSearch = "Practice Code Regional = " & Chr(39) & Me!Text5.Value & Chr(39)
Me.RecordsetClone.FindFirst strSearch
Me.Bookmark = Me.RecordsetClone.Bookmark
Exit Sub
errHandler:
MsgBox "Error No: " & Err.Number & "; Description: " & _
Err.Description
End Sub
I can’t see what I am doing differently. Can anyone help? I am using Acess 2007