View Full Version : go away!


sphere
06-06-2001, 09:49 AM
I have a text box that pops up when i check a certain box.
if there's a record that has data in the pop up box and i create a new record... i still get that blank pop up box (when it shouldn't be cuz the check box isn't marked)
Basically i have to check the box, then uncheck it if i want that text box to go away.
i don't want to do this, the text box should ONLY appear when i check.
That text box needs to go away when i click on new record-

warning: woman on PMS, this is really getting on my nerves!

appreciate the help =)

Peter Paul
06-06-2001, 10:59 AM
With your disclaimer, I am hoping that this will work for you.

set the Visible property for the text box to False

In the After Update property of the check box
put in

If True Then
Me.[Textboxnamehere].Visible = True
Else Me.[Texboxnamehere].Visible = False
End If

I think that will work for you. If it doesn't, well eat some chocolate or something.

Good luck,
Peter

Rich
06-06-2001, 01:36 PM
It should be
If Me.YourChBoxName = True Then
Me.Textboxnamehere.Visible = True
Else Me.Texboxnamehere.Visible = False
End If

And aspirin works well.

Peter Paul
06-06-2001, 03:48 PM
Right you are Rich, thanks.

Peter

sphere
06-08-2001, 06:30 AM
thanx guys but this is how i have it already!
the problem is that when there's data in that box that can be invisible, fine the box is visible. but as soon as i click on new record, the box is still visible when by default it should be gone.
i've already set the default to the check box = 0
isn't there a cure for this??

ps- i'm already cured http://www.access-programmers.co.uk/ubb/wink.gif
thanx again

sphere
06-08-2001, 06:31 AM
correction to quote above..
..."fine, the box is invisible"...

Peter Paul
06-08-2001, 12:44 PM
How big is this thing? Can you send it to me?

Peter

AlanS
06-11-2001, 07:34 AM
Put something like this in the Form_Current event procedure:

TextBox1.Visible = Not(Me.NewRecord) and CheckBox1

That will hide the textbox unless you are on a pre-existing record AND the checkbox is selected. To handle a change in the state of the checkbox while you are editing either a new or pre-existing record, put the following code in the CheckBox1's AfterUpdate event procedure:

TextBox1.Visible = CheckBox1

Hope this helps.