C
CDF
Hi,
I have a form where a user can tick which addresses he/she wants to
print onto sticky labels with a button that opens a confirmation form
when the user is ready to print.
The cofirmation form tells the user to place x amount of sheets of
paper into the printer before pressing OK or Cancel. OK prints the job
(sticky labels), cancel goes back to the original form.
This form has a txt box with the following calculation in it's Control
Source
=Sum(([Count]/24)+0.5)
The forms record source refers to a query which counts how many
addresses in the dbase, therefore the pop up form would count the
number of addresses and work out how many sheets the user needs to put
in the printer. If there were 5 addresses (labels) to print the
message would show:
Please place 1 sheet of blank sticky labels in the printer etc.. OK ,
Cancel.
My problem:
If the original form where you choose the addresses is left blank, ie
no addresses are ticked, then the query would obviously be Null. If
the user presses the button to pop up the confirmation form when it is
NULL, it just shows a blank box and you have to ctrl+Alt+del to get
out of access.
I need to run an if statement in the buttons onclick event procedure
saying 'if the query is null, cancel (or put a message box stating to
choose at least 1 address), else open the confirmation form'.
The query has nothing to do with the form that the button is on, so
I'm not sure how to reference it.
How do I write the code as I'm not a programmer, but I understand it
if told what to write.
If this helps the forms and queries are as follows:
Query: qry_CountOfShowAddress
SELECT tbl_Customers.Customer_AddressShow, Count
(tbl_Customers.Customer_AddressShow) AS [Count]
FROM tbl_Customers
GROUP BY tbl_Customers.Customer_AddressShow
HAVING (((tbl_Customers.Customer_AddressShow)<>No));
confirmation form: frmCountOfAddressLabelSheets
The button is on a form called: frmChooseMailingLabels
Button Name: PrintAddressLabels
Any help would be appreciated.
I have a form where a user can tick which addresses he/she wants to
print onto sticky labels with a button that opens a confirmation form
when the user is ready to print.
The cofirmation form tells the user to place x amount of sheets of
paper into the printer before pressing OK or Cancel. OK prints the job
(sticky labels), cancel goes back to the original form.
This form has a txt box with the following calculation in it's Control
Source
=Sum(([Count]/24)+0.5)
The forms record source refers to a query which counts how many
addresses in the dbase, therefore the pop up form would count the
number of addresses and work out how many sheets the user needs to put
in the printer. If there were 5 addresses (labels) to print the
message would show:
Please place 1 sheet of blank sticky labels in the printer etc.. OK ,
Cancel.
My problem:
If the original form where you choose the addresses is left blank, ie
no addresses are ticked, then the query would obviously be Null. If
the user presses the button to pop up the confirmation form when it is
NULL, it just shows a blank box and you have to ctrl+Alt+del to get
out of access.
I need to run an if statement in the buttons onclick event procedure
saying 'if the query is null, cancel (or put a message box stating to
choose at least 1 address), else open the confirmation form'.
The query has nothing to do with the form that the button is on, so
I'm not sure how to reference it.
How do I write the code as I'm not a programmer, but I understand it
if told what to write.
If this helps the forms and queries are as follows:
Query: qry_CountOfShowAddress
SELECT tbl_Customers.Customer_AddressShow, Count
(tbl_Customers.Customer_AddressShow) AS [Count]
FROM tbl_Customers
GROUP BY tbl_Customers.Customer_AddressShow
HAVING (((tbl_Customers.Customer_AddressShow)<>No));
confirmation form: frmCountOfAddressLabelSheets
The button is on a form called: frmChooseMailingLabels
Button Name: PrintAddressLabels
Any help would be appreciated.