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

Acc2007 force it to make VBA code for an event instead of macro

Status
Not open for further replies.

DougP

MIS
Dec 13, 1999
5,985
US
I write mostly VBA. I use macros for some things.
I usually start a command button with the wizard on, by clicking the first item, Record navigation and Find Next. This adds error checking code as it create the VBA code. I then delete the two lines for Find and write whatever I want. So I'm left with
Code:
Private Sub Command0_Click()
On Error GoTo Err_Command0_Click


Exit_Command0_Click:
Exit sub

Err_Command0_Click:
    msgbox Err.number
    Resume Exit_Command0_Click
End Sub

by default 2007 creates a macro and then when I click Event Procedure I have a blank screen
Code:
Private Sub Command0_Click()
End Sub

DougP
[r2d2] < I love mine
 
Do you have
Office Button>
Access Options>
Object Designers>
Forms/Reports>
Always Use Event Procedures checked?

RuralGuy (RG for short) aka Allan Bunch MS Access MVP acXP winXP Pro
Please respond to this forum so all may benefit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top