Solved passing value from 1 form to another form (1 Viewer)

JRMT

New member
Local time
Today, 21:02
Joined
Dec 3, 2020
Messages
20
Hi Sir's Good Day
i Have 2 Forms 1 Main Form and the certificate form what i want to achieve is when i open certificate form from the main form is to pass the value that i typed in the certificate form and display it on the Main form. both form is in 1 table.
 

Gasman

Enthusiastic Amateur
Local time
Today, 18:02
Joined
Sep 21, 2011
Messages
9,314
Just refer to the form and it's control directly using the full form reference Forms!......
 

JRMT

New member
Local time
Today, 21:02
Joined
Dec 3, 2020
Messages
20
Problem Is that when i open the certificate form and type a value it does not show the Current ID of the Main form. example in my main form the ID is now 500 when i open Certificate form its always in ID 1. what i want to is whatever ID number i am in Main form when i open the certificate number they are both in the same ID Sir. please see attached file.
 

Attachments

  • Capture.JPG
    Capture.JPG
    31.3 KB · Views: 97

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 12:02
Joined
Feb 28, 2001
Messages
21,193
OK, your description gives me a tinge of doubt, but let me try this:

If the certificate form is a sub-form with respect to the main form, then bind the two together based on that number you typed in on the main form. The sub-form wizard can accomplish that for you.


Then the main and sub can be synchronized with each other. If this is NOT what you meant, then your explanation confused me. There are other ways to approach this, but if my suggestion doesn't work, try to give us IN ENGLISH a description of what you want to do.
 

conception_native_0123

Well-known member
Local time
Today, 12:02
Joined
Mar 13, 2021
Messages
1,333
richard,

it looks like the cert form is a pop up and not a sub. it looks like he's got both forms bound to the same table. it seems to me that he has to 'unbind one of them to get this done. perhaps with "docmd.gotoRecord()".
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 12:02
Joined
Feb 28, 2001
Messages
21,193
Adam, if it is not a sub, then my old rule applies: Access won't tell you anything you didn't tell it first, OR tell it how to find it.

If the pop-up ALWAYS wants the value from the text box on the main form, then there is a Forms("form-name").textboxname sort of thing, OR store the desired value in a TempVar or Public variable and have the pop-up just read that variable in the pop-up OnLoad event.
 

JRMT

New member
Local time
Today, 21:02
Joined
Dec 3, 2020
Messages
20
thanks to Sir Arnelgp he fixed my problem.
 

Users who are viewing this thread

Top Bottom