Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to show certain choices in drop down list 1

Status
Not open for further replies.

LouieGrandie

Technical User
Mar 3, 2011
136
0
0
US
Have a form where I have a field that is a drop down and list % of completion. 0, 25,50,75 and 100. However I do not want the 100 to show up unless another field, a check box for completion, is checked. Is that possible. Is it possible to show certain choices depending upon the value of another control on the form?

Visit Sage's Online Community
 
Maybe something in the GotFocus event, like:

Private Sub ComboName_GotFocus()
If CheckBoxName = "True" Then
ListName.RowSource = "0,25,50,75,100"
Else
ListName.RowSource = "0,25,50,75"
End If
End Sub

(With the control RowSourceType property set to Value List)
 
LouieGrandie,
Did you change the names of the controls to match the names of your controls?
I would also change:
Code:
If CheckBoxName = "True" Then
to
Code:
If CheckBoxName = True Then


Duane
Hook'D on Access
MS Access MVP
 
Just realized that there is no way for the end user to edit the list. I was wondering if there is a way to code it so that is one thing is true then it uses Table1 as the source and if it is false then use Table2. I tried changing

Percent.RowSource = Table1 but that doesn't work.

Visit Sage's Online Community
 
Because the client wants it so that if a box it checked they see one list and if it is not checked they see another list. Also on another part of the form they want it so that if they select 1 from a drop down list they see one list and if the select 2 they see a completely different drop down list.

Visit Sage's Online Community
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top