If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
VB Code to Populate text field based on checkbox selection
I have a text field called "Air" that I want automatically updated
(using a form) with air direction based on 3 check boxes. If check box "AirUp" is checked, then "Air" = "UP". If "AirDn" is checked, then "Air" = "DN". If "AirOff" is checked, "Air" = "OFF". I'm new to VB and I can make one or the other work, but can't get it to work if I go to change the check box selection. Can someone help with with the Code? Thanks! |
#2
|
|||
|
|||
VB Code to Populate text field based on checkbox selection
On Sep 16, 11:15*pm, JoMoe wrote:
I have a text field called "Air" that I want automatically updated (using a form) with air direction based on 3 check boxes. *If check box "AirUp" is checked, then "Air" = "UP". *If "AirDn" is checked, then "Air" = "DN". *If "AirOff" is checked, "Air" = "OFF". *I'm new to VB and I can make one or the other work, but can't get it to work if I go to change the check box selection. Can someone help with with the Code? *Thanks! Make life easy on yourself and use a combobox. You can store the real value in the hidden column and show whatever you want in the next column. No code required. |
#3
|
|||
|
|||
VB Code to Populate text field based on checkbox selection
I would suggest putting the check boxes in an option group. As you have it,
what happens if a user checks more than one box? With an option group, the use can select only one box. Also, rather than carrying the text value in the table, it would be easier to use the Option Button Values. The reason being is that when you navigate to a new record, you would have to put code in the form's current event to show the correct box checked. Using the option group, it will handle itself. -- Dave Hargis, Microsoft Access MVP "JoMoe" wrote: I have a text field called "Air" that I want automatically updated (using a form) with air direction based on 3 check boxes. If check box "AirUp" is checked, then "Air" = "UP". If "AirDn" is checked, then "Air" = "DN". If "AirOff" is checked, "Air" = "OFF". I'm new to VB and I can make one or the other work, but can't get it to work if I go to change the check box selection. Can someone help with with the Code? Thanks! |
Thread Tools | |
Display Modes | |
|
|