Hide Command Button

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form with some data and a command button to print some reports.
I want to be able to hide the form until the Social Security Number is filled.
I have been trying to use the if formula but is not working.
Can someone give me the code for this?
 
On the After Update event of the Social Security Number field you can write

Me.[ButtonName].Visible = Not IsNull(Me.[Social Security Number Field Name])
 
Ofer,

Thank you.

I tried it, but it did not work.
I wrote on yesterday's post that I want to hide the form, but that was a typo.
I want to hide the command button.

Also, is there a way to hide the command button depending on the value of a
field.
For instance, for the field [Gender], if value is Male show the command
button and if value is Female, Hide the command button.

Any help would be greatly appreciated.

Ofer Cohen said:
On the After Update event of the Social Security Number field you can write

Me.[ButtonName].Visible = Not IsNull(Me.[Social Security Number Field Name])

--
Good Luck
BS"D


MarcoR said:
I have a form with some data and a command button to print some reports.
I want to be able to hide the form until the Social Security Number is filled.
I have been trying to use the if formula but is not working.
Can someone give me the code for this?
 
For the button you can try, in two place
1. After update event of the Gender field name
2. On Current event of the form

Me.[ButtonName].Visible = (Me.[Gender field name] = "Male")

That should work for the social security number, also write the code in two
locations
1. After update event of the social security number of the field
2. On current event of the form

Me.[ButtonName].Visible = Not IsNull(Me.[Social Security Number Field Name])

--
Good Luck
BS"D


MarcoR said:
Ofer,

Thank you.

I tried it, but it did not work.
I wrote on yesterday's post that I want to hide the form, but that was a typo.
I want to hide the command button.

Also, is there a way to hide the command button depending on the value of a
field.
For instance, for the field [Gender], if value is Male show the command
button and if value is Female, Hide the command button.

Any help would be greatly appreciated.

Ofer Cohen said:
On the After Update event of the Social Security Number field you can write

Me.[ButtonName].Visible = Not IsNull(Me.[Social Security Number Field Name])

--
Good Luck
BS"D


MarcoR said:
I have a form with some data and a command button to print some reports.
I want to be able to hide the form until the Social Security Number is filled.
I have been trying to use the if formula but is not working.
Can someone give me the code for this?
 
Back
Top