Hi peeps,
Is there a way that when you open a form, the opened form will know which form opened it?
I am trying to make a form in which the data in it depends on the form that opens it. I would like to know the code and where to put it in.
Let's say you have Form1 and Form2 and you want to open Form3 so that it knows which form opened it. Let's assume you are using a command button, cmdOpenForm, to open the form.
Do the same for the button's event handler in Form2 but change the bit at the end of the line to "Form2". This is the OpenArgs parameter of the OpenForm action.
In Form3 you can refer to Me.OpenArgs and it will return the name of the form that opened it. Have fun! )
Now, I am trying to get a value from Form1 so Form3 can use it. How do I do that?
Obviously, doing Forms![Me.OpenArgs] would not work because that would be a string. Anyway to do this?
Nevermind, I figured it out. I passed the value needed as an OpenArg.
But I am curious as to the possibility that I can pass more than one value to OpenArgs in case I need more values?
You gave OVERKILL a new meaning Joe. But that's alright. It works nice and dandy.
Now I have a new situation. . .
Ok Form3 has options in it (buttons on mine) and if you click an option, Form3 will close. How do I put that option (a String on my case) into a table I made (a new data)?
If confused, don't hesitate to ask. I will be on the lookout for the next 6 hours. s-)
Well. . . here it goes.
I am trying to make an order menu where the table contains several food and the prices, etc. I also have a form for this. Since sometimes there are 2 prices for a specific item, I made the form (Form1) pop up Form3 which has buttons for choosing which price the customer wants. When a button is pressed, I want the price, the item #, the food name and all that good stuff go to a different table (tblOrders). Now how do I do that?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.