Link to home
Start Free TrialLog in
Avatar of Ronald Malk
Ronald MalkFlag 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,
Avatar of ste5an
ste5an
Flag of Germany image

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.
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

Avatar of 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
ASKER CERTIFIED SOLUTION
Avatar of PatHartman
PatHartman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial