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...
In the "else" statement, what is "LineNumber"? Access gives me a debugger error on this line.
Also, there will be instances where the [count] will not be simply the number 3, it will be whatever value was entered in the main form under [count].
Can I still use this code but replace the
=...
Thanks seaport... that got me part of the way.
Ultimately though, what i want Access to do is AUTOMATICALLY populate those records with the numbers 1, 2 and 3. I dont want the user to be able to mess with these. With the code you sent, they still have to enter the numbers into the subform...
I have a subform (frm_SUB) within a form (frm_MAIN). On my main form I have a field ([Count])that requires the user to enter a number. (frm_SUB) and (frm_MAIN) are linked by a common ID.
What I want to happen is for the subform (set up in data sheet view) to generate, automatically, the number...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.