Opened from which form?

  • Thread starter Thread starter John
  • Start date Start date
J

John

In form X I would like to make a button visible/invisible depending on which
form opened form X. For instance: if form X is opened by form A the button
should be visible, otherwise it should be invisible.
Is this possible?
Thanks in advance,
John
 
Set the button's Visible property to No.

Then in the code that opens it from Form A:
Const strcTarget = "Form1" 'Your form name goes here.
DoCmd.OpenForm strcTarget
Forms(strcTarget)!cmd1.Visible = False

If the form is opened in Dialog mode, pass something in OpenArgs, and test
it in Form_Open.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top