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

mloucel

Member
Local time
Yesterday, 18:35
Joined
Aug 5, 2020
Messages
309
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?
 
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

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.
Good Morning Pat, I have a series of buttons designed as a menu, I got the idea online, was pretty clever, I use hide and show to open the different sections of the menu (5) it works really well and honestly was my very first own code done..
and I tried with a tempvar but I screwed up, I am going to check the solution @arnelgp just sent and go from there, the idea of using open args is tempting I've used it in the past, but my knowledge is very limited, so TIME TO LEARN from the pros..
 
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.
Yes, thank you Arnel, I got the picture, I have used OpenArgs only using Strings, so I was thinking on going on that direction, this gives me a brand-new perspective and the use of the if then, will make it simple.
I am going to adapt this idea and of course give you credit, thank you so much, I also studied the way you structure the do command instead of using a million commas, I've seen it before, but I never thought it was my best friend as well, The filter is a fast way I can add to the sub-form on the menu, to search by DOB as well, I just have to adjust to ##.
Thanks again, once I have it running, I will post as well.
Maurice.
 

Users who are viewing this thread

Back
Top Bottom