Solved Txt box value by Combo selection

Emma35

Registered User.
Local time
Today, 04:04
Joined
Sep 18, 2012
Messages
497
Hi again all......i'm a little disappointed i couldn't work this one out. I've got a form with a combo box (cboPaper) and a text box (txtPaperValue). The combo box allows you to either select Yes or No. If the User selects Yes i'd like the value 0 to appear in the txt box...but if the User selects No i'd like the value 184 to appear in the txt box. Why can't i work this out ?? :)

Thank you
Em
 
First, you could choose a Radio Button or a Check Box for yes/no decisions. Second, if you add code in a _Click event for whatever you use to make that selection, you can load the value you want via VBA.
 
Easy for you to say Mr Doc Man but i'm none the wiser 😊
 
Hi again all......i'm a little disappointed i couldn't work this one out. I've got a form with a combo box (cboPaper) and a text box (txtPaperValue). The combo box allows you to either select Yes or No. If the User selects Yes i'd like the value 0 to appear in the txt box...but if the User selects No i'd like the value 184 to appear in the txt box. Why can't i work this out ?? :)

Thank you
Em
No idea really :(, after all, it is just a simple assignment
Code:
If me.cbopaper = 'Yes' then
    Me.txtpapervalue = 0
Else
    Me.txtpapervalue = 184
Endif
Perhaps also check there is a value in cbopaper?
 
make your combobox 2 column,
with row source: "Yes";0;"No";184

add code on the combo's AfterUpdate event (see Form1 and the code behind).
 

Attachments

Thank you guys it's now working just right. Appreciate your help

Em x
 
So which method did you choose?
These forums are here to help others after all, so only polite if you post your solution. Then that might help someone else in the future?
 

Users who are viewing this thread

Back
Top Bottom