I have a form, frmMailShot, which has an option group, grpMailShotType and two command buttons - cmdLaunchWord and cmdLaunchReport.
The option group is used to select whether the mail shot will be the initial mail shot (value = 1) or a follow-up (value = 2). The command buttons select whether you want to open a pre-written Word mail merge document or a label report. Both will have their results taken from a query, qryMailShot.
The query should differ in the WHERE statement depending on the value of the option group as follows:
If grpMailShotType = 1
If grpMailShotType = 2
This ensures that the only clients selected are either those who have not been contacted previously, or those who have only been sent the initial mail shot.
How do I ensure that the WHERE statement will have changed accordingly when I click either command button?
Thanks in advance for any assistance offered!
The option group is used to select whether the mail shot will be the initial mail shot (value = 1) or a follow-up (value = 2). The command buttons select whether you want to open a pre-written Word mail merge document or a label report. Both will have their results taken from a query, qryMailShot.
The query should differ in the WHERE statement depending on the value of the option group as follows:
If grpMailShotType = 1
PHP:
WHERE (((tblClients.MergeNo)=0));
If grpMailShotType = 2
PHP:
WHERE (((tblClients.MergeNo)=1) AND ((tblClients.Response1)=False));
This ensures that the only clients selected are either those who have not been contacted previously, or those who have only been sent the initial mail shot.
How do I ensure that the WHERE statement will have changed accordingly when I click either command button?
Thanks in advance for any assistance offered!