Avatar of Ronald Malk
Ronald Malk
Flag for Australia asked on

VBA Open form as message will open another form

Hi every one, I don’t know if it can be done, I have a Form " FrmMg " I use it as a pop  up message, what I need is  to be able for the user when click the word (HERE) another form gets opened.

DoCmd.OpenForm " FrmMg "
Forms!FrmMg.TxAA.Value = "Select a Customer From The List OR click (HERE) to enter a new Customer “
I know I can have readymade form with control contain the word “HERE” linked to the other form,  but I’m trying to use same message form for many different scenarios,
* hyperlinksMicrosoft AccessVBA

Avatar of undefined
Last Comment
PatHartman

8/22/2022 - Mon
ste5an

Is it a normal or modal pop-up? In the first case you can use DoCmd.OpenForm to open a further form.

But pop-up over pop-uip form is bad UI and user experience. Can you give use more context for a probably better approach?

When you want to resuse a form and open it multiple times in parallel, then you cannot use DoCmd.OpenForm. In this case you need to create an new instance of the form in VBA, e.g.

Dim newForm As Form_FrmMg
Set newForm = New Form_Mg

Open in new window


But again: more context and a concise and complete sample would be helpful for us to better help you.
Gustav Brock

Set a variable holding the form name, say, "NewCustomer":

FormToOpen = "NewCustomer" ' or other form name.
Forms!FrmMg.TxAA.Value = "Select a Customer From The List OR click (" & FormToOpen & ") to enter a new Customer."

Open in new window

Ronald Malk

ASKER
Sorry,I may have had to say I'm not a real programmer, if you please  I would need the complete code
Your help has saved me hundreds of hours of internet surfing.
fblack61
ASKER CERTIFIED SOLUTION
PatHartman

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.