Shwoing Texbox depending on combo choice (1 Viewer)

stu_c

Registered User.
Local time
Today, 23:28
Joined
Sep 20, 2007
Messages
489
Showing Texbox depending on combo choice

Hi all
I have a form with different info choices in a combo list
NO
Green
Yellow
Red
etc

Ideally what happens is the user fills out the info in a form and selects the appropriate info from the combo box they then click a button and then goes to a report in the correct format, my question is if a user selects "NO" I want a certain textbox to not show in the report but any other colour then it can is this possible?

This is my code so far but struggling to get it to work

Private Sub ComboListColour_Enter()
If Me.ComboListColour = "NO" Then
Me.TextBoxColour.Visible = False

Else

Me.Text44.Visible = True

End If
End Sub
 
Last edited:

Ranman256

Well-known member
Local time
Today, 18:28
Joined
Apr 9, 2015
Messages
4,339
you want the AFTERUPDATE event, and
you have 2 textbox in use here. If you are using only the 1, then:

if you only want the txtBoxColor box visible then:
Code:
   Me.TextBoxColour.Visible =  Me.ComboListColour = "YES"
assuming ComboListColour IS in fact a string and not boolean.

Im not sure what Text44 is for, relating to TextBoxColour. if it IS 2 boxes needing the event then:

Code:
sub ComboListColour_AFTERUPDATE()
    Me.TextBoxColour.Visible = Me.ComboListColour = "YES" 
    Me.Text44.Visible = Me.ComboListColour = "NO" 
end sub
 

stu_c

Registered User.
Local time
Today, 23:28
Joined
Sep 20, 2007
Messages
489
hello
I have tried the above when I go into properties the AfterUpdate event isn't there?

also my way in thinking is the NO is allowing it to be visible rather than hidden in the below code?

sub ComboListColour_AFTERUPDATE()
Me.TextBoxColour.Visible = Me.ComboListColour = "NO"
end sub
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 23:28
Joined
Jul 9, 2003
Messages
16,273
when I go into properties the AfterUpdate event isn't there

Sounds like you are looking at a label, not a text box or combo box...


Sent from my SM-G925F using Tapatalk
 

stu_c

Registered User.
Local time
Today, 23:28
Joined
Sep 20, 2007
Messages
489
Sounds like you are looking at a label, not a text box or combo box...


Sent from my SM-G925F using Tapatalk


Defiantly a text box mate only thing I can think of is you can't use Update event in a report :/
 

Users who are viewing this thread

Top Bottom