Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating multi queries from a form

Status
Not open for further replies.

Graystorm2

Technical User
Apr 2, 2007
10
US
I am working on a project that will allow my staff to track ILL infomation. I have a single table, and I can create select queries and have them reported. However, I want an option to do more the one query at a time from something that looks like a form so my front end staff can use it.
I am new to programing database so take it easy on me. Just good websites that explains this and examples would help.

I spent about 2 hrs on here reading threads, I have read a lot and I think its possible to do what I want but I am just missing some key word or idea.

work flow idea
Staff opens form > Select field wishing to be queried > query is made > report is given
 
Here's one way. You could create an Option Group on your form. Then have a command button to either preview or print the report. The button would have code on its On Click event. Such as the following: (Note: RptFrame is the name of the OptionGroup, the 1,2,3,4,5 are the position of the radio buttons, the reports are your basic reports and the WClause filters the source of the reports based on what option is selected.)

Private Sub Command9_Click()
Dim WClause, RName
Select Case [RptFrame]
Case 1
WClause = "[DateOfLease] Between #" & _
Me![Start] & "# AND #" & _
Me![End] & "#"
RName = "Sales_And_Leasing_Rpt"
Case 2
WClause = "[FinalSettlementDate]is null"
RName = "Sales_Pending_Report"
Case 3
WClause = "[FinalSettlementDate] Between #" & _
Me![Start] & "# AND #" & _
Me![End] & "#"
RName = "Sales_Report"
Case 4
WClause = "[FinalSettlementDate] Between #" & _
Me![Start] & "# AND #" & _
Me![End] & "#"
RName = "Sales_Report_Monthly"
Case 5
WClause = "[ReviewedDate] Between #" & _
Me![Start] & "# AND #" & _
Me![End] & "#"
RName = "Reag_Review_Date_Count_Rpt"
End Select

DoCmd.OpenReport _
ReportName:=RName, _
WhereCondition:=WClause, _
view:=Me![OutputTo]
End Sub

 
Thanks for the help. As I thought this over, I have conculded that I should start with the form and so moved my question over to the forms forum.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top