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

MINOR Q: select Control Name and Event from VBA drop-down

Status
Not open for further replies.

lorirobn

MIS
Mar 15, 2005
450
0
0
US
Hi,

This is a minor question, more of a pet peeve, but I'll ask anyway.

I'm in the VBA window for my form, and want to select a Control Name from the drop-down list for my form. Let's say I want the event to be After_Update. When I select the control name, VBA automatically puts 'Before_Update' event code in my module. I have to delete it and then lick on the After_Event drop-down box.

There's gotta be a way to click on a control and then click on the event I want, before Access puts in code - but how???

Call me newbie...
Lori
 
#1: Turn off the wizard (the little majic wand thing). When it's on and you select Build Event, Access guesses at what you want to do.

#2: When the wizard is off, you should right click on the control and view properties, then "build" with the "..." button in the event you want.

MyControl_Before_Update()

End Sub

MyControl_After_Update()

End Sub

MyControl_Another_Red_Hearing_Entry()

End Sub

MyControl_On_Double_Click()

End Sub

MyControl_On_Click()
MsgBox "Finally Some Real Code ! "
End Sub

Alan J. Volkert
Fleet Services
GE Commercial Finance Capital Solutions
(World's longest company title)
Eden Prairie, MN
 
Thanks, Alan, that worked, and that's good to know. But geez...is there no shorter way to add a specific event when you're already in the VBA window?

Thanks again...
Lori
 
Well, you could just start typing it. If the object exists on the form VB will recognize it. But then again, what did you expect from Billy-Boy ? ;-)

Alan J. Volkert
Fleet Services
GE Commercial Finance Capital Solutions
(World's longest company title)
Eden Prairie, MN
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top