G
Guest
I am trying to make a form that finds records from a table and displays them
in a form.
I have created a form and placed the required fields onto the form. I have
created an unbound combo box and added an expression to the on change
property.The code looks like this
Private Sub Combo8_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "Str([vrm]) = " & Str(Nz(Me![Combo8], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
It is supposed to look in a field called vrm ("text" type in the table
concerned), and then compare it to the value in the combo box ( combo8). It
then displays all the fields required from the table in question on the form.
It works so long as the values in the vrm field in the table are numbers, it
falls over if any vrm value if a string. It states type mismatch in crtieria
expression. W
Can any one suggest the changes required to the code to make this work with
string values?
in a form.
I have created a form and placed the required fields onto the form. I have
created an unbound combo box and added an expression to the on change
property.The code looks like this
Private Sub Combo8_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "Str([vrm]) = " & Str(Nz(Me![Combo8], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
It is supposed to look in a field called vrm ("text" type in the table
concerned), and then compare it to the value in the combo box ( combo8). It
then displays all the fields required from the table in question on the form.
It works so long as the values in the vrm field in the table are numbers, it
falls over if any vrm value if a string. It states type mismatch in crtieria
expression. W
Can any one suggest the changes required to the code to make this work with
string values?