G
Guest
I am looking for the code to be able to enter data into a field on a form and
after update, it will search for the data in the query (any part of the
field) and open a form and show the record. Below is the code I have.
Private Sub Test1_AfterUpdate()
Dim myDB As Database
Dim criteria As String
Dim item As String
Dim response As Integer
Dim workset As Recordset
item = Me![Test1]
criteria = "[Description] = '" & item & "'"
Set myDB = CurrentDb()
Set workset = myDB.OpenRecordset("tblDailySupport", DB_OPEN_SNAPSHOT)
workset.FindFirst (criteria)
If workset.NoMatch Then
response = MsgBox("No Cases match.")
Else
DoCmd.OpenForm "frmTestSearc1"
End If
'DoCmd.FindRecord criteria
End Sub
Currently the findfirst on the workset will only bring up the record if it
is typed exactly correct. I want it to look at the whole field and match any
part of the field.
HELP
after update, it will search for the data in the query (any part of the
field) and open a form and show the record. Below is the code I have.
Private Sub Test1_AfterUpdate()
Dim myDB As Database
Dim criteria As String
Dim item As String
Dim response As Integer
Dim workset As Recordset
item = Me![Test1]
criteria = "[Description] = '" & item & "'"
Set myDB = CurrentDb()
Set workset = myDB.OpenRecordset("tblDailySupport", DB_OPEN_SNAPSHOT)
workset.FindFirst (criteria)
If workset.NoMatch Then
response = MsgBox("No Cases match.")
Else
DoCmd.OpenForm "frmTestSearc1"
End If
'DoCmd.FindRecord criteria
End Sub
Currently the findfirst on the workset will only bring up the record if it
is typed exactly correct. I want it to look at the whole field and match any
part of the field.
HELP