Make Item (Text or Box) appear on certain selection

CJAlla

Registered User.
Local time
Today, 09:16
Joined
Jan 4, 2008
Messages
18
Hi All,

First post in this forum, looking for some help. Im sure its pretty simple for you guys :cool:

Ive got a List box, which has three items in. "1 (One)" , "3 (Three), "5 (Five)".

Im trying to get some text to make it self visible when only "5 (Five)" is selected. Have tried based on other samples on the forum but having no luck.

Id like it to pop up when "5 (Five)" is selected, and also whenever a record is gone to with "5 (Five)" selected.

Anyone help me with some coding for this.


Thanks in advance..im sure theres going to be many more questions from me :rolleyes:
 
so in the afterupdate of the listbox if you do
Code:
if me.yourlistboxname="5" then
me.yourtextname.visible= true
else
me.yourtextname.visible=false
you could probably put this code someplace else to be more efficient, but the listbox controls should give u an idea
 
Assuming your text is in a label named HiddenText (could just as well be in a textbox with the same name) and you listbox is named, YourListBox, then go into the Properties for HiddenText and set the Visible property to No. Then use this code:

Code:
Private Sub YourListBox_AfterUpdate()
 If Me.YourListBox = "5 (Five)" Then
   Me.HiddenText.Visible = True
 Else
   Me.HiddenText.Visible = False
 End If
End Sub

Private Sub Form_Current()
If Me.YourListBox = "5 (Five)" Then
   Me.HiddenText.Visible = True
 Else
   Me.HiddenText.Visible = False
 End If
End Sub

The second set of code is needed so that when returning to the record the text will be displayed or not. The listbox has to be bound to your underlying data for this to work.

Linq
 
Last edited:
Thank you both for your help.

Have tried this and it just doesnt seem to appear whether i click on 5 or not.

"The second set of code is needed so that when returning to the record the text will be displayed or not. The listbox has to be bound to your underlying data for this to work."

What do you mean bound to your underlying data?..sorry to seem dumb.. lol.


Thanks again.
 
It seems that even with it set to visible, with this coding in it still does not display... hmm..
 
post up a sample of your db so we can look
 
change it to this

Code:
Private Sub ItemSection_AfterUpdate()
 If Me.ItemSection.Column(1) = "5 (Five)" Then
   Me.Label77.Visible = True
 Else
   Me.Label77.Visible = False
 End If
End Sub


Private Sub Form_Current()
If Me.ItemSection.column(1) = "5 (Five)" Then
   Me.Label77.Visible = True
 Else
   Me.Label77.Visible = False
 End If
End Sub
 
Ahhhh!!!!

Your a genius! Thank you!

:D:D:D:D:D
*shakes hand*


change it to this

Code:
Private Sub ItemSection_AfterUpdate()
 If Me.ItemSection.Column(1) = "5 (Five)" Then
   Me.Label77.Visible = True
 Else
   Me.Label77.Visible = False
 End If
End Sub


Private Sub Form_Current()
If Me.ItemSection.column(1) = "5 (Five)" Then
   Me.Label77.Visible = True
 Else
   Me.Label77.Visible = False
 End If
End Sub
 
Hey sorry to bring it up again... but .... :)

What about if it was a tick box? What should the "Column(1)" be?

Currently I have it as:

If Me.ShippedTick = "Yes" Then

But its doing the same as before we put the column bit in.

"ShippedTick" being the tick box name of course :)

Thanks


You are welcome!!

and im not a genius. i just get lucky
 
Ah ive solved it. silly me was using "" and yes instead of true. doh.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom