after Menu click, open a form and that form opens a specific one.

mloucel

Member
Local time
Today, 05:13
Joined
Aug 5, 2020
Messages
279
Hello all:

I need ADVICE,

I have a form that will be opened thru a menu, this form has 2 purposes:

- Open SearchF and then once a record is chosen, open a form to edit PersonF.
- Open SearchF and with the INFO of that record, fill CompleteRecordF to add data.

PersonF only has Info that is taken from SearchF.
Now I have another menu Item that opens CompleteRecordF, but first must open SearchF and once SearchF is closed, then open CompleteRecordF with some of the data and be able to finish CompleteRecordF.

My solution was to create 2 copies of SearchF [A & B], and with VBA I can easily open whatever form I need, no problem, but I would like to have only 1 SearchF and be able to see who is calling the SearchF form from the menu item, then once SearchF is closed thru a button, SearchF will open the correct form PersonF or CompleteRecordF.

Depending on which form is open, I have routines that do what they need to do to pass the correct info to the opening form, so I will have to modify a bit SearchF, but is not complicated.

Any Ideas will be appreciated.

The program is working fine, and when I tested with a couple of End Users, they have no idea how is done, but it works, the extra Job is just for me, I just want to know if there is a way to code this 1 form, and once closed decide which form to open based on which menu item was picked.

is confused I know, so if there are any ideas or maybe a little example that will be great.

Maurice.
 
Hi. Are you already using the OpenArgs parameter?
Thanks but,
Sorry not sure at all how I would do that, since [I believe], I would need to send something from the menu to SearchF, then using the close button I will have to do something to open either PersonF or CompleteRecordF.
But I have no idea how to do such, sorry.
 
What are you using as a menu? You could always create a TempVar and in the click event of the menu button, put a value in the tempVar that indicates which menu item was selected.
 
here is a demo of using OpenArgs mentioned by DBGuy.
open MainForm (on design view. see the code on opening SearchF).
also the code on Double click event on CustomerID of SearchF.
 

Attachments

Users who are viewing this thread

Back
Top Bottom