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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form_Open() event

Status
Not open for further replies.

Rickalty

Technical User
Jun 29, 2001
42
0
0
US
Hi all, I'm obviously missing something basic here.

When a form (frmOpenSplash) opens, I want it to display a value in a label. I can't get the Form_Open() event to work at all though.

My code is...

Code:
Private Sub Form_Open()
lblNoOfQuestions.Caption = "20"
End Sub
I've also tried Private sub UserForm_Open(), also to no avail.

What am I doing wrong please?

Richard
 
I don't see an Open event listed anywhere. How did you come about trying to use that?
Code:
Private Sub UserForm_Initialize()
    lblNoOfQuestions.Caption = "20"
End Sub
 
Thank you very much. I was sure that Form_Open was right, but UserForm_Initialize is working. Thanks for the advice.
 
I was sure that Form_Open was right, but UserForm_Initialize is working."

Why were you sure Form_Open was right? Have you used it before? I doubt it, as DaveInIowa is correct...there is no _Open event for a userform.

Do you use the Object/Event dropdowns in the code module? They list all objects, and all events available for each of them. Handy things.

"A little piece of heaven
without that awkward dying part."

advertisment for Reese's Peanut Butter Cups (a chocolate/peanut butter confection)

Gerry
 
Ah, but this IS the VBA forum. Further, judicious use of the code module dropdowns would have made it clear. I do not know about most people using the dropdowns, but I sure as heck use them.

"A little piece of heaven
without that awkward dying part."

advertisment for Reese's Peanut Butter Cups (a chocolate/peanut butter confection)

Gerry
 
Thanks, everyone. The problem was that I've mostly worked in VB itself rather than VBA, and the differences keep biting me.

Fumei is right... using the dropdown list would have saved me hassle :)

Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top