Solved Changing textbox values (1 Viewer)

ClaraBarton

Registered User.
Local time
Today, 07:05
Joined
Oct 14, 2019
Messages
451
I have a popup that has 3 combo boxes and 3 textboxes that are the control sources for each combo (=nz(1stCombo,0), etc.
On closing the popup, the 3 textbox values are placed in a table and used for default values when popup is loaded next time.
All good unless the first combo after update doesn't fire the next two Or the second combo doesn't fire the third, etc.
Some drawers do not contain Divisions, or divisions do not contain folders, etc.
If they aren't fired, they retain the original value when it should go to 0.
I've tried setting their values to 0 in the after update event of the first combo when the recordsource of the succeeding combo is changed.
I get an error of "you can't assign a value to this object"
How would I go about changing these textboxes?
 

Minty

AWF VIP
Local time
Today, 15:05
Joined
Jul 26, 2013
Messages
10,368
If the textboxes are bound to the combo's then you can't change their value, you would have to set the value of the combo that drives them.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 22:05
Joined
May 7, 2009
Messages
19,233
remove the textboxes ControlSource (eg: = Nz(1Combo, 0)

instead use the Form's Load event to assign the default value:

private sub form_load
me.textbox1= nz([1Combo], 0)
end sub

then, you can assign value to these textboxes through vba.

you assign their value on each combo's AfterUpdate event:

private 1Combo_AfterUpdate()
Me.texbox1 = 1Combo
end sub
 

Users who are viewing this thread

Top Bottom