what's the diff?

skate

Registered User.
Local time
Today, 10:16
Joined
May 22, 2002
Messages
136
i have a textbox that displays values from a selection made in a combobox. does it matter if i just put the code in "on load" and not in the "beforeupdate"?
 
That depends on your intention. Current is a good event for scrolling through records. AfterUpdate is a good one for after you change a combobox or text box.

Load should probably not be for putting data in a specific record on the form, because what will happen when you switch records? (unless you've blocked that possibility for the user).

Depending on what you're trying to do, you may not need any code at all. Can you give an example/be more descriptive?
 
Last edited:
Mytextbox=Mycombobox.column(1)
i put in load, current, onchange. I don't really know which i should be using, what isn't necessary, i just tried to cover all the bases.
 
If you want to display a column of the combo in a separate textbox, you need the code in two places (or one place and execute it twice). It needs to be in the Current event because that event fires every time a new record is displayed on the form and it needs to go into the AfterUpdate event of the combobox because that event is fired after the combo is changed. Any other place is unnecessary.
 
And you only need the code if you're actually _storing_ the extra column from the combo box. If you're just displaying it, set the control source of the text box = ComboName.Column(x) (for some reason, you have to leave off the Me. part).

Actually having store the extra column is relatively rare, and should only be done when you cannot rely on being able to go back to it later and it having the same value. Price information is a good example of this.
 

Users who are viewing this thread

Back
Top Bottom