M
Michael Conroy
I need to clearify whether or not my form naming convention is preventing my
code from running. The main form is named "frm MainMenu" and the subform is
"frm Options", and yes there is a space after the m, it makes it easier for
me to read it.
Now on my main form in the afterupdate event of the "WorkOptions" option box
I am grabbing the value and trying to change the recordsource of the sub
form. The code errors out saying it can't find the FIELD "frm Options", when
I expect it to be looking for a form. (Error 2465) I thought the square
brackets made it look like a field, but what else can you wrap around a form
name to cover spaces? The A97 code looks like this:
Dim Criteria As String
Dim strSQL As String
Dim Target As Byte
Target = Me.WorkOption
Criteria = "Category = " & Target
strSQL = "SELECT [tbl Options].* " & _
"FROM [tbl Options] " & _
"WHERE (" & Criteria & ");"
Me![frm Options]!Form.RecordSource = strSQL
As always and help will be greatly appreciated. Thanks
code from running. The main form is named "frm MainMenu" and the subform is
"frm Options", and yes there is a space after the m, it makes it easier for
me to read it.
Now on my main form in the afterupdate event of the "WorkOptions" option box
I am grabbing the value and trying to change the recordsource of the sub
form. The code errors out saying it can't find the FIELD "frm Options", when
I expect it to be looking for a form. (Error 2465) I thought the square
brackets made it look like a field, but what else can you wrap around a form
name to cover spaces? The A97 code looks like this:
Dim Criteria As String
Dim strSQL As String
Dim Target As Byte
Target = Me.WorkOption
Criteria = "Category = " & Target
strSQL = "SELECT [tbl Options].* " & _
"FROM [tbl Options] " & _
"WHERE (" & Criteria & ");"
Me![frm Options]!Form.RecordSource = strSQL
As always and help will be greatly appreciated. Thanks