M Garcia,
Rather than using the global variable (poor idea for several reasons), you should consider sending the client# to the 2nd form as a parameter via the forms' .openargs.
That way, you can read the .openargs in the form's _open, _load, or _current events (_load would likely be best) and then respond by opening or positioning the (bound?) recordset appropriately BEFORE the form gets UI focus.
Then you can handle the logic for edit or new record appropriately as well.
On 09/27/2022 12:42 PM M Garcia via groups.io <toukey1=yahoo.com@groups.io> wrote:
hello,
I have a form (form1) with a button that opens another form (form2) and I am passing the client# from form1 to form2 by way of a global variable. This is working fine.
This is my problem:
When I open form1 and then click the button for form2, although it has the correct client# on Form2, the other information on the form is what I entered for another client.
My question is when I open form2, how can I get the information for that client alone (if it already exists) or be able to enter a new record for that client?
For example......Client 100 I entered DP# on Form 2. When I go to Client 200, the DP# for Client 100 is showing.
Hopefully the above is clear enough for you to understand. If not, please let me know.
Regards
Toukey
Tidak ada komentar:
Posting Komentar