PC Review


Reply
Thread Tools Rate Thread

BeforeUpdate and KeyDown

 
 
croy
Guest
Posts: n/a
 
      14th Mar 2011
For a combobox control, I have put some code behind the
BeforeUpdate event, and it works very well... unless the
user enters the value by using a key that I've set the
KeyDown event for--then the BeforeUpdate code doesn't seem
to fire.

I tried to add a call to the BeforeUpdate code in the OnExit
event, but I can't seem to make that work, either.

If I put this line in:

Call cboMarkTypeId_BeforeUpdate

I get a message stating that the argument is not optional.

If I put this line in:

Call cboMarkTypeId_BeforeUpdate(Cancel As Integer)

I get a different error message.

I also noticed that if there is a Default Value set for the
field, and it is tabbed thru, accepting the Default Value,
the BeforeUpdate code doesn't fire.

How can I get the BeforeUpdate code to fire when a KeyDown
event enters a value, or when the Default Value is not
molested?

--
croy
 
Reply With Quote
 
 
 
 
John W. Vinson
Guest
Posts: n/a
 
      14th Mar 2011
On Mon, 14 Mar 2011 09:32:09 -0700, croy <(E-Mail Removed)> wrote:


>How can I get the BeforeUpdate code to fire when a KeyDown
>event enters a value, or when the Default Value is not
>molested?


BeforeUpdate fires only when the user actually manually updates the field.
Either put the same code in your KeyDown event, or call the BeforeUpdate event
from your KeyDown code:

Call Form.BeforeUpdate(Cancel as Integer)
--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/For...-US/accessdev/
http://social.answers.microsoft.com/.../en-US/addbuz/
and see also http://www.utteraccess.com
 
Reply With Quote
 
Stuart McCall
Guest
Posts: n/a
 
      15th Mar 2011
"John W. Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> wrote in message
news:(E-Mail Removed)...
> On Mon, 14 Mar 2011 09:32:09 -0700, croy <(E-Mail Removed)> wrote:
>
>
>>How can I get the BeforeUpdate code to fire when a KeyDown
>>event enters a value, or when the Default Value is not
>>molested?

>
> BeforeUpdate fires only when the user actually manually updates the field.
> Either put the same code in your KeyDown event, or call the BeforeUpdate
> event
> from your KeyDown code:
>
> Call Form.BeforeUpdate(Cancel as Integer)


Ahem.

Call Form.BeforeUpdate(False)

> --
>
> John W. Vinson [MVP]
> Microsoft's replacements for these newsgroups:
> http://social.msdn.microsoft.com/For...-US/accessdev/
> http://social.answers.microsoft.com/.../en-US/addbuz/
> and see also http://www.utteraccess.com
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
beforeupdate =?Utf-8?B?bm9vZGxlQnJhaW4=?= Microsoft Access Form Coding 4 11th Jul 2006 11:15 PM
BeforeUpdate shampoo Microsoft Access Forms 3 21st Nov 2005 05:40 PM
Using BeforeUpdate Gary Schuldt Microsoft Access Forms 1 17th Apr 2004 07:57 AM
BeforeUpdate Jack Microsoft Access VBA Modules 1 27th Aug 2003 05:16 PM
Re: field's BeforeUpdate vs form's BeforeUpdate Allen Browne Microsoft Access Forms 1 31st Jul 2003 01:48 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:02 AM.