1
votes

My goal is to open a specific record from a list box to populate a different form with that specific data that was double clicked on. My column name is Claim ID 15 on the list box and in the master table that contains all data. This column contains values such as C123456789. On the Master table, Claim ID 15's data type is short text. When I double click on the row in the list box it gives me the following error: Run-time error '3075': syntax error (missing operator)in query expression '[Claim_ID_15=C123456789'.

Private Sub SearchList_DblClick(Cancel As Integer)
    DoCmd.OpenForm "profileForm", , , "Claim ID 15=" & SearchList

End Sub

I have a rudimentary understanding of visual basic, thank you in advance.

2

2 Answers

0
votes

Advise not to use spaces nor punctuation/special characters in naming convention. If you do, must enclose object names in [ ] characters. Also, parameters for text fields must have apostrophe delimiters. Use # for date/time field, nothing for number field.

DoCmd.OpenForm "profileForm", , , "[Claim ID 15]='" & SearchList & "'"

0
votes

Thank you for the help and the information! I made the changes and it worked

Private Sub SearchList_DblClick(Cancel As Integer)
    DoCmd.OpenForm "profileForm", , , "[Claim ID 15]='" & SearchList & "'"

End Sub