Default value in Combo box - Help!

G

Guest

I have a text box on a form. I also have a combo box on the same form. I
would like the default value of the combo box to match the value in the text
box.

I am not familiar with the coding, so i have been trying to do it with the
expression builder, to no avail.

Any ideas would be very welcome!
 
G

Guest

MightyMo,

Use the textbox afterupdate event with something like

cboComboBox = txtTextBox

If both controls display the same data, why not just edit the combobox
directly and get rid of the textbox perhaps? This way Access will try and
match the characters to values in the list, making entry much faster.


swas
 
G

Guest

Thank you swas,

for various (boring) reasons I need tehse to be separate and so cannot lose
the text box. Simply put, the text box on the form will show me my starting
valuse - on some records these will change to the combo box value - This way
i keep track of 'what was'and 'what is'.

Back to your suggestion - the problem (I think) is that the values in the
text box are fixed at the start and so will not trigger the afterupdate box.

MM
 
G

Guest

MightyMo,

No worries. By 'fixed at the start' I take it to mean when the form loads?
If so, use the form load event instead, or whatever event that occurs when
you want to update the cbo.

Sometimes you need to fiddle around with events to see when they fire to
decide where to place code. Use a line like

msgbox "Form load event"

in the form load event for example, and it will pop up to tell you when it
fires.


swas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top