By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,068 Members | 830 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,068 IT Pros & Developers. It's quick & easy.

Run-time error 3075 syntax error (missing operator) open on double click from listbox

P: 8
Hello,
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'.

Expand|Select|Wrap|Line Numbers
  1. Private Sub SearchList_DblClick(Cancel As Integer)
  2.     DoCmd.OpenForm "profileForm", , , "Claim ID 15=" & SearchList
  3.  
  4. End Sub
  5.  
  6.  
I have a rudimentary understanding of visual basic, thank you in advance.
4 Weeks Ago #1

✓ answered by Gilley178

Thank you for the advice! I made the following changes and it worked:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub SearchList_DblClick(Cancel As Integer)
  3.     DoCmd.OpenForm "profileForm", , , "[Claim ID 15]='" & SearchList & "'"
  4.  
  5. End Sub

Share this Question
Share on Google+
4 Replies


100+
P: 134
Hi.
Maybe

"Claim ID 15 = '" & SearchList & "'"
4 Weeks Ago #2

P: 8
Thank you for the response. I updated the code and it to:

Expand|Select|Wrap|Line Numbers
  1. Private Sub SearchList_DblClick(Cancel As Integer)
  2.     DoCmd.OpenForm "profileForm", , , "Claim ID 15= '" & SearchList & "'"
  3.  
  4. End Sub
  5.  
However it still resulted in a runtime error with the same message.
4 Weeks Ago #3

Rabbit
Expert Mod 10K+
P: 12,427
You should avoid spaces in object names. If you do use them, you have to surround the name in square brackets. Otherwise it has no way of knowing when a name begins and when it ends.
4 Weeks Ago #4

P: 8
Thank you for the advice! I made the following changes and it worked:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub SearchList_DblClick(Cancel As Integer)
  3.     DoCmd.OpenForm "profileForm", , , "[Claim ID 15]='" & SearchList & "'"
  4.  
  5. End Sub
4 Weeks Ago #5

Post your reply

Sign in to post your reply or Sign up for a free account.