Run-Time error '3075' (1 Viewer)

L0b0

Registered User.
Local time
Yesterday, 19:19
Joined
Jan 25, 2019
Messages
22
I keep getting this run-time error and im not sure why. Its saying Syntax error (missing operator) in query expression 'Store Name = 'test store".
I have a list box thats connected to a Query and im trying to make it so when I double click on the store in the listbox it opens up a form to edit the details.

Code:
DoCmd.OpenForm "Tbl_StoreMasterEDIT", , , "Store Name = '" & Me.SearchResults.Column(0) & "'"
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Yesterday, 21:19
Joined
Feb 28, 2001
Messages
27,001
Can the search results ever include a string that contains an apostrophe? If so, you have a different issue relating to substitution - an abnormal termination of the search string.
 

Minty

AWF VIP
Local time
Today, 02:19
Joined
Jul 26, 2013
Messages
10,355
This is a problem of having spaces in your table / field names. Try

Code:
DoCmd.OpenForm "Tbl_StoreMasterEDIT", , , "[Store Name] = '" & Me.SearchResults.Column(0) & "'"
 

L0b0

Registered User.
Local time
Yesterday, 19:19
Joined
Jan 25, 2019
Messages
22
This is a problem of having spaces in your table / field names. Try

Code:
DoCmd.OpenForm "Tbl_StoreMasterEDIT", , , "[Store Name] = '" & Me.SearchResults.Column(0) & "'"

That did it!:banghead: Thank you!
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Yesterday, 21:19
Joined
Feb 28, 2001
Messages
27,001
Oops - missed the spaces in the name, Minty. Good catch.
 

Users who are viewing this thread

Top Bottom