U
upsman via AccessMonster.com
I have a field on a form, that for the purpose of my test, contains the value
"HSN". I have the following code in the OnOpen event of a completely
different form:
Dim stLinkCriteria As String
Dim stCampus
MsgBox "campus = " & Forms!Switchboard!txtCampus
stLinkCriteria = "SELECT * FROM Classes WHERE Campus = " & Forms!Switchboard!
txtCampus
Me.RecordSource = stLinkCriteria
When the form opens, the msgbox says "campus = HSN". This is correct. But
when it gets to the stLinkCriteria statement, an 'Enter Parameter Value' box
pops up and asks for me to enter a value for the field "HSN". Why does it
think "HSN" is a field and not the value in the field? I want to select all
records where Classes.Campus matches whatever value is in Forms!Switchboard!
txtCampus. How do I do that?
Rod
"HSN". I have the following code in the OnOpen event of a completely
different form:
Dim stLinkCriteria As String
Dim stCampus
MsgBox "campus = " & Forms!Switchboard!txtCampus
stLinkCriteria = "SELECT * FROM Classes WHERE Campus = " & Forms!Switchboard!
txtCampus
Me.RecordSource = stLinkCriteria
When the form opens, the msgbox says "campus = HSN". This is correct. But
when it gets to the stLinkCriteria statement, an 'Enter Parameter Value' box
pops up and asks for me to enter a value for the field "HSN". Why does it
think "HSN" is a field and not the value in the field? I want to select all
records where Classes.Campus matches whatever value is in Forms!Switchboard!
txtCampus. How do I do that?
Rod