I am using the following code in a subform to limit the number of enteries:
form_beforeInsert event:
If Me.Recordset.RecordCount = 3 Then
MsgBox "Maximum 3 line items can be entered!"
Cancel = True
End If
Now what I want is to replace the "3" with an user inputed value from the main form.
ex. If Me.Recordset.RecordCount = [forms]![frm_MAIN]![controlname].....
What would be the proper way to do this?
form_beforeInsert event:
If Me.Recordset.RecordCount = 3 Then
MsgBox "Maximum 3 line items can be entered!"
Cancel = True
End If
Now what I want is to replace the "3" with an user inputed value from the main form.
ex. If Me.Recordset.RecordCount = [forms]![frm_MAIN]![controlname].....
What would be the proper way to do this?