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

Combo Box - Enter a value without triggering an update?

P: n/a

Does anyone know if there is a way to add a text value to a combo box (the
text box part, not the rowsource) in VBA without triggering an update
event? I've tried everything I can think of without success.

What I want is a combo box that I set the rowsource for in VBA and requery
it, then it drops down, and enters a probable selection that may or may
not already be in the list to the text box portion. Then I can manually
compare the probable selection to the contents of the dropdown and decide
whether to select an option already in the dropdown...or use the value
that was pasted in the textbox.

My problem is when I try to paste this probable selection into the combo
box. I have tried using sendkeys to copy and paste, DoCmd.RunCommand
acCmdPaste, and just setting the value based on that of another text box.
These methods always trigger the afterupdate event, onnotinlist event,
close the dropdown of the combo box, or all of the above. When I manully
copy and paste a value into the combo box though this does not happen. Is
there a way to put a value in there without actually "submitting it", or
maybe a way to only allow the field to be updated if I hit enter or click
to select an option.

I'm using Access 2002 with an ADP with SQL Server 2000 if it makes a
difference.

Any help would be very much appreciated.
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Thanks for the advice. I had actually tried that as well, with the same
problem result. I may have stumbled upon a workaround for the problem
though. It seems to be working so far. I
setfocus,dropdown,setfocus,paste value,then dropdown again. It seems to
make a difference if you do a send keys or use a command for certain
actions or combinations of actions. Certain combinations acted
differently eventhough they all were supposed to do the same thing.

Me.Control.SetFocus
SendKeys "{F4}", True
Me.Control.SetFocus
DoCmd.RunCommand acCmdPaste
SendKeys "{F4}", True

Thanks again

On Fri, 05 Sep 2003 02:38:04 GMT, Allen Browne
<ab***************@bigpond.net.au> wrote:
If the combo has focus, you could try setting the Text of the combo.


Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.