By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,136 Members | 1,205 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,136 IT Pros & Developers. It's quick & easy.

access 97 : command button question

P: n/a
hello

this is absolutely ridiculous :) i have a simple form where if you
click the "main menu" command button it should ideally go to the main
menu . however, each time i click the menu command button i receive
an error message "the expression On Click you entered as an event
property setting produced the following error: user-defined type not
defined." i just don't understand when i actually used the wizard or
have the simple code of the following:

private sub btnMainMenu()
docmd.close
end sub

any help would be appreciated :)
thanks! jung
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
The OnClick event in the button's Properties sheet needs to be set to [Event Procedure],
the first line of the procedure should be

Private Sub btnMainMenu_Click()

--
Wayne Morgan
"JMCN" <pi******@yahoo.fr> wrote in message
news:27**************************@posting.google.c om...
hello

this is absolutely ridiculous :) i have a simple form where if you
click the "main menu" command button it should ideally go to the main
menu . however, each time i click the menu command button i receive
an error message "the expression On Click you entered as an event
property setting produced the following error: user-defined type not
defined." i just don't understand when i actually used the wizard or
have the simple code of the following:

private sub btnMainMenu()
docmd.close
end sub

any help would be appreciated :)
thanks! jung

Nov 12 '05 #2

P: n/a
pi******@yahoo.fr (JMCN) wrote in
news:27**************************@posting.google.c om:
hello

this is absolutely ridiculous :) i have a simple form where if
you click the "main menu" command button it should ideally go
to the main menu . however, each time i click the menu
command button i receive an error message "the expression On
Click you entered as an event property setting produced the
following error: user-defined type not defined." i just don't
understand when i actually used the wizard or have the simple
code of the following:

private sub btnMainMenu()
docmd.close
end sub

any help would be appreciated :)
thanks! jung


In the OnClick event of your button, change the btnmainmenu() to
Event Procedure, then rename your function to
private sub btnMainMenu_click() instead of btnMainMenu()
Bob Q.
Nov 12 '05 #3

P: n/a
> In the OnClick event of your button, change the btnmainmenu() to
Event Procedure, then rename your function to
private sub btnMainMenu_click() instead of btnMainMenu()
Bob Q.


Thanks for your help but I realized when I sent this post, it was a
typo because I forgot to type in "_click" after the btnMainMenu.

Thanks fo you suggestions. I think I'm going to start over and
recreate the form.

Jung
Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.