Using a Combo-box to set Check-box property to yes

G

Guest

I have a combo-box that has the following choices: In-Progress, Inventory,
Demo, Sold. Depending on the selection made I need to set a check box on the
form to "Yes or True?" The check-boxes are called: Act:IP, Act:Inv, Act:Demo,
Act:Sold. Is it possible to do this? Thanks for your help.
 
V

Van T. Dinh

Use the AfterUpdate Event of the ComboBox to assign the value(s) of the
CheckBox(es).

I assumed these CheckBoxes are independent CheckBoxes and not part of an
Option Group / Frame.

Check Access VB Help on the AfterUpdate Event of a ComboBox.
 
G

Guest

I know to use the afterupdate event of the combobox, but I'm not sure of the
proper syntax to set the value for the checkbox. Can you give me an example?
 
G

Guest

Thanks for your help, I figured it out before you posted your reply. Here is
the way I did it just in case anyone else needs to know:

Private Sub Stat_AfterUpdate()
Select Case Stat
Case Is = "Inventory"
Me![Act:Inv] = True
Me![Act:IP] = False
Me![Act:Demo] = False
Me![Act:Sold] = False

Case Is = "In-Progress"
Me![Act:IP] = True
Me![Act:Inv] = False
Me![Act:Demo] = False
Me![Act:Sold] = False

Case Is = "Demo"
Me![Act:Demo] = True
Me![Act:IP] = False
Me![Act:Inv] = False
Me![Act:Sold] = False

Case Is = "Sold"
Me![Act:Sold] = True
Me![Act:IP] = False
Me![Act:Inv] = False
Me![Act:Demo] = False
End Select

End Sub

Thanks again
 

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

Similar Threads


Top