Good afternoon all
i have started teaching myself coding a couple of weeks ago and have started work on a new programme which uses a number placed in a text box (called txt_findPSV_Serial_No) to search for a record that matches the same number in a database query and pull back all the relevant information into other text boxes, i have managed to bond the programme to the query though my coding is displaying 'runtime error 3001' against the coloured line below. Can anyone help with this it would be much appreciated
Private Sub Command1_Click()
Dim Content As String
Content = Trim(txt_findPSV_Serial_No) & "*"
Content = "PSV_Serial_No like'" & Content & "'"
If txt_findPSV_Serial_No = "" Then
MsgBox ("please enter PSV Serial Number")
End If
If Len(txt_findPSV_Serial_No) <> 6 And Len(txt_findPSV_Serial_No) <> 7 And Len(txt_findPSV_Serial_No) <> 10 Then
MsgBox ("Please enter 6, 7 or 10 digit serial number")
Else
PSV_Search.Recordset.Find Content
End If
If Error Then Exit Sub
End With
End Sub
Many thanks
i have started teaching myself coding a couple of weeks ago and have started work on a new programme which uses a number placed in a text box (called txt_findPSV_Serial_No) to search for a record that matches the same number in a database query and pull back all the relevant information into other text boxes, i have managed to bond the programme to the query though my coding is displaying 'runtime error 3001' against the coloured line below. Can anyone help with this it would be much appreciated
Private Sub Command1_Click()
Dim Content As String
Content = Trim(txt_findPSV_Serial_No) & "*"
Content = "PSV_Serial_No like'" & Content & "'"
If txt_findPSV_Serial_No = "" Then
MsgBox ("please enter PSV Serial Number")
End If
If Len(txt_findPSV_Serial_No) <> 6 And Len(txt_findPSV_Serial_No) <> 7 And Len(txt_findPSV_Serial_No) <> 10 Then
MsgBox ("Please enter 6, 7 or 10 digit serial number")
Else
PSV_Search.Recordset.Find Content
End If
If Error Then Exit Sub
End With
End Sub
Many thanks