Disappearing SubForm

crhodus

Registered User.
Local time
Yesterday, 21:19
Joined
Mar 16, 2001
Messages
257
I've added a SubForm to my main form. I don't want the user to be able to add records to the table that populates the SubForm, but I do want them to be able to edit a record if it is displayed in the SubForm.

I changed the SubForm's "Allow Additions" property to False to prevent users from adding records. When browsing through records in the main form, my SubForm will disappear if there is no record to load.

I did some research and saw where changing the "Allow Additions" property to True will prevent this from happening. But now I'm back where I started. The user can now add records using the SubForm.

Does anyone have a suggestion on what to do with a situation like this??

Thanks,
Crhodus
 
That's normal behavior with "Allow Additions" property set to False and no records to load.

I'd leave "AllowAdditions" set to True and go to the Form_Current event (in the subform) and put something in like

Code:
Private Sub Form_Current()
If Me.NewRecord Then
 MsgBox "Remember That You Cannot Add New Records To The Subform!"
 Me.Undo
 Me.Requery
End If
End Sub
 
Thanks for the suggestion!

CRhodus
 

Users who are viewing this thread

Back
Top Bottom