Go Back   Access World Forums > Microsoft Access Discussion > Modules & VBA

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 04-29-2010, 01:35 PM   #1
Rx_
Nothing In Moderation
 
Rx_'s Avatar
 
Join Date: Oct 2009
Location: Denver, Colorado
Posts: 2,803
Thanks: 636
Thanked 341 Times in 311 Posts
Rx_ has a spectacular aura about Rx_ has a spectacular aura about Rx_ has a spectacular aura about
difference between clicking and calling click event in command button?

A form for a dropdown list box with an add new mode has a "Continue" and "Undo" command button with code.
When using the command buttons, the applications works perfectlly.
The customer doesn't like "accept" or "undo" buttons and wanted a Message Box with a Yes/NO (I know, but it is a culture here).
So, I added a message box:
YES has code to Call Continue_Click and it works like a charm.
NO has code to Call Undo_Click - and it fails.
If I click Undo command button directly, it works, setting the pull down list box back to the orginal value.
But, using the Call method, it runs the code (seen in debugger) but won't reset the pull down list box to its orginal value.
(there are no local variables in the click event)
Have also moved the focus off of the dropdown.
Just wondering why the difference?

There must be some other event going on.

10 If Not IsNull(Me.rsAddNew.Fields(1).Value) Then
20 Me.rsAddNew.Delete
30 Me.rsAddNew.Bookmark = rsAddNewBookmark
40 Else
50 rsAddNew.CancelUpdate ' was still (new) record
70 End If

Rx_ is offline   Reply With Quote
Old 04-29-2010, 01:46 PM   #2
Rx_
Nothing In Moderation
 
Rx_'s Avatar
 
Join Date: Oct 2009
Location: Denver, Colorado
Posts: 2,803
Thanks: 636
Thanked 341 Times in 311 Posts
Rx_ has a spectacular aura about Rx_ has a spectacular aura about Rx_ has a spectacular aura about
Re: difference between clicking and calling click event in command button?

Observation:
I notice that the form current event runs with the command button, but not when using the Call method for the code.

Copied all the code in the command button into the yes/no message box and see that the form current does not run either.

There is no code in the form current.
Rx_ is offline   Reply With Quote
Old 05-23-2010, 02:13 AM   #3
msr681
Registered User
 
Join Date: May 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
msr681 is on a distinguished road
Re: difference between clicking and calling click event in command button?

Technically there is no difference between Click and Command Events both functions same for details follow this link
http://www.templatevariety.com/aspne...command-event/

msr681 is offline   Reply With Quote
Reply

Tags
call , click , method

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
need help in automatic updating database from xml pushkar1986 Modules & VBA 6 05-27-2013 12:13 PM




All times are GMT -8. The time now is 10:42 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World