Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing form propeties in an OnLoad Event?

Status
Not open for further replies.

FiendClub

Technical User
Jul 29, 2002
4
US
I have a subform based on a query. The orders form opens with a customer up and the user can see all orders placed by the given customer in this sub form.

Problem: sometimes this form appears blank and I've noticed to get the form to appear correctly I have to reset the following (subform)form properties to True. AllowEdits/AllowAdditions/ AllowDeletions/ DataEntry.

1.) Why would this form suddenly change its properties to = fase/no. (problem occurs mostly using Access97 on a Win95 system)

2.) The fix I tried is below, but being new to VBA I'm not confident it is even executable. Does the VB look good for OnLoad? If not, any other suggestions?

Code:
Private Sub Form_Open(Cancel As Integer)
    AllowEdits = False
    AllowDeletions = False
    AllowAdditions = True
    DataEntry = True
End Sub
 
I'm no expert. But if you above code doesn't work you could try this:

Private Sub Form_Open(Cancel As Integer)
Me.AllowEdits = False
Me.AllowDeletions = False
Me.AllowAdditions = True
Me.DataEntry = True
End Sub


Hope this helps!
 
Thanks for the Me suggestion I threw that in to be safe. Still have yet to have the problem re surface. We'll see? Any other suggestions are welcomed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top