I am attempting to create a mail merge database which can create printable labels and need to increase the number of generated labels of certain types based on user input.
I have a main form which has some fields which appear on every label (name and DOB) then I have created a subform which contains a field "Selected" (Yes/No), "Medication" (text), "Strength" (text) and then a "Copies" (number, limited to 1-9) stored in a table tblTempMedications.
The subform is prepopulated with some default data and users can select these or enter new entries as they see fit. I have another temporary table set up (tblMailMerge)which is linked to a Word Mail Merge.
I am wanting to set up a button which users push that creates a new entry for all records which have "selected" ticked BY the number in the "Copies" field for that record. i.e. if the users clicks the check box "selected" for a line and then selects "3" in the copies field I need that information copied 3 times to the temporary table. (the "copies" field does not need to come across, only multiply it). It then moves on to the next selected record and creates an entry based on that data and copy number.
The record consists of the default information "Name" "DOB" "Today's Date" and then the information stored in the record in the subform.
I have all the subsequent coding set up to create the mail merge for each record in the tblMailMerge so that is why I am trying to do it this way.
Can someone suggest how I step through the SQL insert commands taking into account the "copies" value?
I have a main form which has some fields which appear on every label (name and DOB) then I have created a subform which contains a field "Selected" (Yes/No), "Medication" (text), "Strength" (text) and then a "Copies" (number, limited to 1-9) stored in a table tblTempMedications.
The subform is prepopulated with some default data and users can select these or enter new entries as they see fit. I have another temporary table set up (tblMailMerge)which is linked to a Word Mail Merge.
I am wanting to set up a button which users push that creates a new entry for all records which have "selected" ticked BY the number in the "Copies" field for that record. i.e. if the users clicks the check box "selected" for a line and then selects "3" in the copies field I need that information copied 3 times to the temporary table. (the "copies" field does not need to come across, only multiply it). It then moves on to the next selected record and creates an entry based on that data and copy number.
The record consists of the default information "Name" "DOB" "Today's Date" and then the information stored in the record in the subform.
I have all the subsequent coding set up to create the mail merge for each record in the tblMailMerge so that is why I am trying to do it this way.
Can someone suggest how I step through the SQL insert commands taking into account the "copies" value?