I have a form where the user enters multiple records and since some fields in each record often repeat they asked for a duplicate button. That part works. However, now they'd like it to automatically "Duplicate" based on square feet. Each 100 feet requries a record. So for 101 sqft I need two records.
1. They are required to fill in the first record
2. They enter the square feet
3. After update on Sq ft I created code that calculates the number of records I need to add.
If they entered 101 feet I need to add one more record for a total of 2.
Is there a way to call the Duplicate code (from a subform) x times?
Is there a better way to do this?
Here's my Duplicate code
Private Sub cmdDup_Click()
On Error GoTo Err_cmdDup_Click
strSpotPaintProduct = cboSpotPaintProduct
strSpotCoat = cboSpotCoat
strSpotItemDesc = cboSpotItemDesc
strSpecifiedDFT = txtSpecifiedDFT
DoCmd.GoToRecord , , acNewRec
cboSpotPaintProduct = strSpotPaintProduct
cboSpotCoat = strSpotCoat
cboSpotItemDesc = strSpotItemDesc
txtSpecifiedDFT = strSpecifiedDFT
DoCmd.GoToControl "txtA1"
Exit_ccmdDup_Click:
Exit Sub
Err_cmdDup_Click:
MsgBox Err.Description
End Sub
Start Free Trial