I limited Number of records in continuous form, but now can't add records

bigalpha

Registered User.
Local time
Today, 05:47
Joined
Jun 22, 2012
Messages
415
I've attached two pictures. One shows my form with the Transporters Subform with 3 entries, and 1 entry.

The three line items that say "Transporter" are in one subform. I used this code
Code:
Private Sub Form_Current()
If Me.RecordsetClone.RecordCount >= 3 Then
Me.AllowAdditions = False
End If
End Sub
to limit the number of records I can add to 3 or less.

My issue is that I lost the blank text box that allows you to add another record. So, if I only have one Transporter listed, there's no box to let me add a second or third.

I have the following properties for the Transporters Subform set to "Yes":
Data Entry
Allow Additions
Allow Deletions
Allow Edits
Allow Filters
 

Attachments

  • frmManifestInfo.PNG
    frmManifestInfo.PNG
    43.1 KB · Views: 133
  • frmManifestInfo2.PNG
    frmManifestInfo2.PNG
    47.4 KB · Views: 142
You have set the AllowAdditions property to False, but at no point allowed for it to be re-set to True, Try;
Code:
Private Sub Form_Current()
If Me.RecordsetClone.RecordCount >= 3 Then
     Me.AllowAdditions = False
Else
     Me.AllowAdditions = True
End If
End Sub
 
I think John got it in one there! :)
 
You have set the AllowAdditions property to False, but at no point allowed for it to be re-set to True, Try;
Code:
Private Sub Form_Current()
If Me.RecordsetClone.RecordCount >= 3 Then
     Me.AllowAdditions = False
Else
     Me.AllowAdditions = True
End If
End Sub

Sorry for the delay, I had a 3 day weekend! This addition to the code worked great! Thanks Mr. Big Booty.
 

Users who are viewing this thread

Back
Top Bottom