Form load event procedure doesn't work

G

Guest

I'm having a problem with an Access form named 'Form1' using VBA. I'm trying
to set an event procedure when the form opens to initialize form attributes
(e.g., enabling a check box named 'CheckAll'). The problem is that Access
attempts to set the attributes before the form even opens - thus, the
attributes don't set. Here's the code:

Private Sub Form_Open()
Me.CheckAll.Enabled = True
End Sub

I've tried using: me.checkall..., form1.checkall..., checkall..., etc. I've
also tried different events like: Form_Load(), Form_Initialize(), -- and
also, Form1_Load(), Form1_Initialize(), etc. Having no success. Anybody
have a solution??
 
F

fredg

I'm having a problem with an Access form named 'Form1' using VBA. I'm trying
to set an event procedure when the form opens to initialize form attributes
(e.g., enabling a check box named 'CheckAll'). The problem is that Access
attempts to set the attributes before the form even opens - thus, the
attributes don't set. Here's the code:

Private Sub Form_Open()
Me.CheckAll.Enabled = True
End Sub

I've tried using: me.checkall..., form1.checkall..., checkall..., etc. I've
also tried different events like: Form_Load(), Form_Initialize(), -- and
also, Form1_Load(), Form1_Initialize(), etc. Having no success. Anybody
have a solution??

The Form's Open event is to early in the loading process.
Use the Form's Load event instead.

Private Sub Form_Load()
Me!CheckAll.Enabled = True
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top