Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Click on command button and then hide it 1

Status
Not open for further replies.

gmeunier

Programmer
Nov 6, 2000
9
FR

Hi everyone,

I have a form whith cascading options (option2 control depends on option1 selection).

Once the user has picked up all the necessary controls the submit button appears.

When the user click on that submit button, macro his doing its job with the data and the form needs to be reinitialized.

No problem for that except for the submit button :
As the macro was launched from a OnClick procedure, Access refuses to hide its control, a debug window appears.

What could be the trick to hide that button back?

Many thanks,

Gérald

 
You can't hide a control that (still) has the focus, such as your submit button.

As the next-to-last step in your vba or macro, set the focus to another field on the form,or at least a transparent command button - this will then allow you to make the submit button invisible again, in the last step.

A transparent command button can receive the focus, but can't be clicked..and is invisible..

Jim

If at first you don't succeed, skydiving probably isn't for you!
Another free Access forum:
More Access stuff at
 

Last step of vba :
I set the focus on my first option control on which I allocated a onFocus event which hides the button.

Works very well!

Many thanks,

Gérald
 
Gérald
Another common place to put this is type of thing

On Current Record event

which would include logic to set colours, visible / not visible formatting on the form.

Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top