I am trying to create a form where the details of the record appear when the unique id is selected from the combo box.
I have a vehicle database with 2 tables. Vehicle data, which holds make, model, reg etc and the other table holds annual data, service costs, bodywork cost, mileage. The two tables are linked by regno field.
I would like to create the annual data form with a combo box listing all the registrations of vehicles in the database and then the make, model etc fields display the relevant details. The fields change if the combo box entry changes.
I had this working in another database where the key was a number field. The key in this db is a text field. I used the code below
dim rs as object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Reg_Number] = " & Str(Me![RegNo])
Me.Bookmark = rs.Bookmark
But when I try the above I get the error type mismatch on the middel line. It doesn't seem to like me having the key field a text.
Does anyone know how I can get this working with a text field.
Thanks
I have a vehicle database with 2 tables. Vehicle data, which holds make, model, reg etc and the other table holds annual data, service costs, bodywork cost, mileage. The two tables are linked by regno field.
I would like to create the annual data form with a combo box listing all the registrations of vehicles in the database and then the make, model etc fields display the relevant details. The fields change if the combo box entry changes.
I had this working in another database where the key was a number field. The key in this db is a text field. I used the code below
dim rs as object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Reg_Number] = " & Str(Me![RegNo])
Me.Bookmark = rs.Bookmark
But when I try the above I get the error type mismatch on the middel line. It doesn't seem to like me having the key field a text.
Does anyone know how I can get this working with a text field.
Thanks