visible = true or false

Makaveli

Access SMP
Local time
Today, 13:57
Joined
Jul 1, 2008
Messages
17
I have a few text boxes and retangles on a form, the textboxes are full of formulas, when you enter the data in three of the text boxes i press a button which runs the formula populating the other text boxes with data.

What im trying to do is make the text boxes that are populated with data from the formulas to be hidden (not visable) until i press the button and the formulas ran.

This form opens from a menu form if that helps, I've been a newbie to access, ut im feeling alot more confident and understand most things, if someone could point me in the right direction it'd be a great help.

Im not online now till monday enjoy your weekend.
 
The code would be

Me.TextBoxName.Visible = True

or False to hide it.
 
pbaldy is right. I usually default those controls to hidden until the button is clicked, them show them using the clicked event of the button and VBA.
 
Solved

It works! thanks :)

I baffled my brains tring to disable it from within the other forms button, I wouldn't have thought about disabling it from the propertys menu.
 
Another Way?

I have the one form which the users can open in edit mode or data entry mode. The problem is that the form changes a little as theres some data on it that shouldnt be viewed in edit mode.

I would create two seperate forms but this would require me to change aload of other things to.

As the forms open from seperate buttons from the menu form, is there away for me to make a few objects (text boxes) not visible. as the form is opened.

like some sought of if formula or on load sub?????

I've been trying to do this for the last 2hrs :mad:.... i might have to go to the dentist cause my teeth are almost ground down to nothing:(......The worst part is i have no ciggarettes and im the only one that smokes at work.:eek:

Please help me
 
I have the one form which the users can open in edit mode or data entry mode. The problem is that the form changes a little as theres some data on it that shouldnt be viewed in edit mode.

I would create two seperate forms but this would require me to change aload of other things to.

As the forms open from seperate buttons from the menu form, is there away for me to make a few objects (text boxes) not visible. as the form is opened.

like some sought of if formula or on load sub?????

I've been trying to do this for the last 2hrs :mad:.... i might have to go to the dentist cause my teeth are almost ground down to nothing:(......The worst part is i have no ciggarettes and im the only one that smokes at work.:eek:

Please help me
Sure. Just add the Your_Control_Name.Visible = False (or True) code in the "On Open" or "On Load" event of the form and use the OpenArgs to specify what controls should be visible. For example..
One button has this code to open the form:
Code:
DoCmd.OpenForm "your form name", , , , , , "a"
and the other has:
Code:
DoCmd.OpenForm "your form name", , , , , , "b"
Now on the On Open event of your form you could use:
Code:
    If Me.OpenArgs = "a" Then
        SomeTextboxA.Visible = False
    ElseIf Me.OpenArgs = "b" Then
        SomeTextboxB.Visible = False
    End If
Good luck! :)
 
Oh after reading your post again I realised the only difference is the one time your form is on Data Entry mode and the other time it isn't. So the following should suffice:
Code:
    If Me.DataEntry = True Then  '(or False)
        SomeTextbox.Visible = False
    End If
 
Solved

Thanks :) both ways work great :D

My teeth are feeling better already and my need for nicoteen is slowly decreasing. :p
 

Users who are viewing this thread

Back
Top Bottom