Please bear with me... I'm not great with Access, and I'm completely dumb with VBA. I'm completely VBA Illiterate.
That said, I'm trying to do a search thing with a combo box in a pop-up form. I got the form from hayley and have been trying to convert it for my needs. It comes up fine, and looks great, but then when I select the record from the list, that form is supposed to close and the "kardex main form" is supposed to show up with that record.
INSTEAD, when I select the record from the list, I get a missing operator error and I don't know what it means or how to fix it. I'll paste the code and see if anyone can decipher by looking at it.
Private Sub lstNames_Click()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "kardex main form"
stLinkCriteria = "[fldName]=" & Me![lstNames]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Me![lstNames] = ""
DoCmd.Close acForm, "frm Wild Search"
End Sub
The error message says:
Syntax error (missing operator) in query expression '[fldName]=A & D Welding'.
A & D Welding is the record i clicked on when I got the error.
When I select "debug," it highlightes the line:
DoCmd.OpenForm stDocName, , , stLinkCriteria
Does anyone have a thought about this? Do I need to provide more information? I'd be happy to.
Thanks in advance, you're all wonderful.
--Sara
That said, I'm trying to do a search thing with a combo box in a pop-up form. I got the form from hayley and have been trying to convert it for my needs. It comes up fine, and looks great, but then when I select the record from the list, that form is supposed to close and the "kardex main form" is supposed to show up with that record.
INSTEAD, when I select the record from the list, I get a missing operator error and I don't know what it means or how to fix it. I'll paste the code and see if anyone can decipher by looking at it.
Private Sub lstNames_Click()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "kardex main form"
stLinkCriteria = "[fldName]=" & Me![lstNames]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Me![lstNames] = ""
DoCmd.Close acForm, "frm Wild Search"
End Sub
The error message says:
Syntax error (missing operator) in query expression '[fldName]=A & D Welding'.
A & D Welding is the record i clicked on when I got the error.
When I select "debug," it highlightes the line:
DoCmd.OpenForm stDocName, , , stLinkCriteria
Does anyone have a thought about this? Do I need to provide more information? I'd be happy to.
Thanks in advance, you're all wonderful.

--Sara
Last edited: