funderburgh
Registered User.
- Local time
- Today, 15:54
- Joined
- Jun 25, 2008
- Messages
- 118
I manage an Access application that in many instances uses data selected from a combo on a form for variable criteria. In this instance it is in the form of:
[Forms]![Main Navigation]![Print Menu]![SchoolYear]
I recently wrote a routing that exports to Excel based on a record set derived from a query. In testing I hard-coded the criteria (School Year) in the query. Once everything worked I sustituted the variable above. Now, in the VBA, no records are put into the recordset, but here is the "HUH?" - when I run the queries directly from Access they work correctly, drawing the results for the school year selected on the form referenced.
Although I don't think it pertains, here is the code:
'Create The Recordset
If Me.Frame11 = 1 Then
strQueryName = "ExcelHS"
GroupTitle = "High School"
Else
strQueryName = "ExcelMS"
GroupTitle = "Middle School"
End If
Set objRst = Application.CurrentDb.OpenRecordset(strQueryName)
Any ideas would be welcome. Thanks
[Forms]![Main Navigation]![Print Menu]![SchoolYear]
I recently wrote a routing that exports to Excel based on a record set derived from a query. In testing I hard-coded the criteria (School Year) in the query. Once everything worked I sustituted the variable above. Now, in the VBA, no records are put into the recordset, but here is the "HUH?" - when I run the queries directly from Access they work correctly, drawing the results for the school year selected on the form referenced.
Although I don't think it pertains, here is the code:
'Create The Recordset
If Me.Frame11 = 1 Then
strQueryName = "ExcelHS"
GroupTitle = "High School"
Else
strQueryName = "ExcelMS"
GroupTitle = "Middle School"
End If
Set objRst = Application.CurrentDb.OpenRecordset(strQueryName)
Any ideas would be welcome. Thanks