Printing Quarterly reports of different Suppliers

E

EPB

I want to print quarterly reports from a list of suppliers. What is the best
way to do this?

I would actually like to create a table that has the [Supplier], [Start] and
[end] dates for the report and the [Report name]. Have a switchboard form
that actually allows me to select a button to print these reports BUT I DON'T
KNOW ENOUGH ABOUT ACCESS TO PROGRAM THE BUTTONS AND ETC. TO GET THIS TO WORK.

I can make the table and make a switchboard form but how do I link this all
together?
 
E

Evi

I'm guessing that you want a blank, unbound form which contains something
like a combo box to let you choose the Supplier names from your Suppliers
tables and a couple of text boxes to let you type the start and end dates.
Then you would have a button to tell the report to open.

This is the sort of code you would put into the On Click event of the
button, adapting it to your own Control and report names.

Dim stDocName As String
Dim MyFrom As Long
Dim MyTo As Long
Dim MySupplier As Integer
Dim Crit As String
'2 text boxes, txtFromDate and txtToDate allow the users to type in the From
and To dates
'to filter the report
'My date field is called WkDate
'A combo box, cboSupplier allows you to choose a Supplier.
'It contains SupID (the primary key field of the Suppliers table - which is
also in your report) and Supplier

stDocName = "RptFullDetails"
' the name of your report
MySupplier = Me.cboSupplier
MyFrom = Format(Me.txtFromDate, "0")
MyTo = Format(Me.txtToDate, "0")
Crit = "[WkDate]Between " & MyFrom & " AND " & MyTo & " AND [ProdID]=" &
MyProd
DoCmd.OpenReport stDocName, acPreview, , Crit
End If
Evi
 
E

EPB

I actually want a button that will print all reports from a specific table of
Suppliers and their report dates. The table would contain the following
fields; [Supplier], [ReportName]. Not all suppliers need the quarterly
report so this table would define which suppliers and which report.

I want the button to parse each line in the table and print that report. I
also wanted the code to ask what quarter the reports are for and then figure
out the start and end dates.

Evi said:
I'm guessing that you want a blank, unbound form which contains something
like a combo box to let you choose the Supplier names from your Suppliers
tables and a couple of text boxes to let you type the start and end dates.
Then you would have a button to tell the report to open.

This is the sort of code you would put into the On Click event of the
button, adapting it to your own Control and report names.

Dim stDocName As String
Dim MyFrom As Long
Dim MyTo As Long
Dim MySupplier As Integer
Dim Crit As String
'2 text boxes, txtFromDate and txtToDate allow the users to type in the From
and To dates
'to filter the report
'My date field is called WkDate
'A combo box, cboSupplier allows you to choose a Supplier.
'It contains SupID (the primary key field of the Suppliers table - which is
also in your report) and Supplier

stDocName = "RptFullDetails"
' the name of your report
MySupplier = Me.cboSupplier
MyFrom = Format(Me.txtFromDate, "0")
MyTo = Format(Me.txtToDate, "0")
Crit = "[WkDate]Between " & MyFrom & " AND " & MyTo & " AND [ProdID]=" &
MyProd
DoCmd.OpenReport stDocName, acPreview, , Crit
End If
Evi

EPB said:
I want to print quarterly reports from a list of suppliers. What is the best
way to do this?

I would actually like to create a table that has the [Supplier], [Start] and
[end] dates for the report and the [Report name]. Have a switchboard form
that actually allows me to select a button to print these reports BUT I DON'T
KNOW ENOUGH ABOUT ACCESS TO PROGRAM THE BUTTONS AND ETC. TO GET THIS TO WORK.

I can make the table and make a switchboard form but how do I link this all
together?
 
E

EPB

Also, Instead of the "Crit" variable, what if I had a query for the form you
are talking about? Would I call
DoCmd.Openreport MyReportName, acPreview, MyQueryName

I tried the above and when printing I keep being asked for each Variable in
the the Form i.e. the Supplier, StartDate, EndDate. If these are already
being called from the form in the query, why I am being asked to enter them?
Is my query not directed properly?

The query works if I get out of the printing form and go to the main page of
the switchboard and execute a button from there.



Evi said:
I'm guessing that you want a blank, unbound form which contains something
like a combo box to let you choose the Supplier names from your Suppliers
tables and a couple of text boxes to let you type the start and end dates.
Then you would have a button to tell the report to open.

This is the sort of code you would put into the On Click event of the
button, adapting it to your own Control and report names.

Dim stDocName As String
Dim MyFrom As Long
Dim MyTo As Long
Dim MySupplier As Integer
Dim Crit As String
'2 text boxes, txtFromDate and txtToDate allow the users to type in the From
and To dates
'to filter the report
'My date field is called WkDate
'A combo box, cboSupplier allows you to choose a Supplier.
'It contains SupID (the primary key field of the Suppliers table - which is
also in your report) and Supplier

stDocName = "RptFullDetails"
' the name of your report
MySupplier = Me.cboSupplier
MyFrom = Format(Me.txtFromDate, "0")
MyTo = Format(Me.txtToDate, "0")
Crit = "[WkDate]Between " & MyFrom & " AND " & MyTo & " AND [ProdID]=" &
MyProd
DoCmd.OpenReport stDocName, acPreview, , Crit
End If
Evi

EPB said:
I want to print quarterly reports from a list of suppliers. What is the best
way to do this?

I would actually like to create a table that has the [Supplier], [Start] and
[end] dates for the report and the [Report name]. Have a switchboard form
that actually allows me to select a button to print these reports BUT I DON'T
KNOW ENOUGH ABOUT ACCESS TO PROGRAM THE BUTTONS AND ETC. TO GET THIS TO WORK.

I can make the table and make a switchboard form but how do I link this all
together?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top