Need help please. Created a form with buttons that work fine for me. The form is on a front-end database that is linked to a back-end on a remote server. When I mail the front-end db to an end-user, he can link to the back-end, but when he opens the form and clicks on the 'search' button, he gets the 3270 error. Here's the code:
I'm new to Access Forms, so if I need to do anything else to clean up or make this code more usable to other users, please help. How do I identify which property is not being found?
Code:
Private Sub SearchF_Click()
DoCmd.Close acQuery, "SearchQ", acSaveNo
Dim db As Database
Dim rs As DAO.Recordset
Dim strSql As String
Set db = CurrentDb
If Me.[TEST] = "" And Me.fName = "" And Me.[Address1] = "" And Me.City = "" And Me.Zip = "" And Me.St = "" Then
GoTo endsub
End If
strSql = "SELECT [TEST_Data].[TEST #], [TEST_Data].Name, [TEST_Data].[Address 1], [TEST_Data].[Address 2], [TEST_Data].City, [TEST_Data].Zip, [TEST_Data].St " _
& "FROM [TEST_Data] " _
& "WHERE [TEST_Data].[TEST #] Like '*" & Me.[TEST] & "*' " _
& "And [TEST_Data].Name Like '*" & Me.[fName] & "*' " _
& "AND [TEST_Data].[Address 1] Like '*" & Me.[Address1] & "*' " _
& "And [TEST_Data].City Like '*" & Me.[City] & "*' " _
& "AND [TEST_Data].Zip Like '*" & Me.[Zip] & "*' " _
& "And [TEST_Data].St Like '*" & Me.[St] & "*' "
With CurrentDb.QueryDefs("SearchQ")
.SQL = strSql
End With
DoCmd.OpenQuery "SearchQ"
endsub:
End Sub
I'm new to Access Forms, so if I need to do anything else to clean up or make this code more usable to other users, please help. How do I identify which property is not being found?