On Change Event in Combo Box Problem (1 Viewer)

Emohawk

What a wicked mullet...
Local time
Today, 14:00
Joined
Mar 14, 2002
Messages
79
Hi Folks,
Have a problem that has jinxed me for a while.

I am using a Combo Box to select a customer and in the "On Change" event I have VBA code that takes the value of the user input in the Combo Box and uses it as part of an SQL query to populate various Fields depending on the input.

My problem is this, the "On Change" event is triggered when a new character is typed into the combo box but the value of the combo box does not reflect the addition of this new character.

I.e.
Combo Box Value = -> "A"

Type Letter "B"

OnChange event triggered Code happens using "A" instead of "AB" but Combo Box shows that "AB" is in the field!!!

Whats going on!!!

I'm thinking of a work around of using a On_KeyPress event, capturing the key adding that to the contents of my field THEN executing my code with that value but this seems ridiculous... ARGH!!! Please Help!!!

P.S. I'm using Access97... Is this something perculiar to it?

P.P.S. Just for the record I used to be a member but my username was deleted from the register... Whats going on!?!?!?

[This message has been edited by Emohawk (edited 03-14-2002).]
 

David R

I know a few things...
Local time
Today, 08:00
Joined
Oct 23, 2001
Messages
2,633
There was an attack on the site a month or so ago, in answer to your PPS. Several people's accounts went away in the recovery from it. All posts remained, thankfully.

David R
 

Emohawk

What a wicked mullet...
Local time
Today, 14:00
Joined
Mar 14, 2002
Messages
79
Thanks guys. Placing the code in the After Update event does work but this code is only triggered after the user leaves the field ala Lost Focus event (or selects the option from the combo box). Does anyone know whats actually happening? Is there any point in having an On Change event if you can't register the change... >
 

David R

I know a few things...
Local time
Today, 08:00
Joined
Oct 23, 2001
Messages
2,633
Are you trying to filter the entire form after every keypress? Sounds terribly inefficient.
Probably the reason OnChange wasn't doing what you expected is that it's registering the value immediately before the keystroke, i.e. "A" instead of "AB". Did you try Me.FieldName.Value to see if that gives you the correct 'value' currently?
 

Users who are viewing this thread

Top Bottom