473,386 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Linking Pop up form to Main form

I have a main form with a combo box where if a specific customer is
selected a popup form opens and additional information required for
this customer is entered into the form. Data from the main form and
popup form is stored in the same table. I have a field called
certification that I would like to use to link the forms.

Oct 26 '07 #1
2 1788
Greetings,

what you need to do is to open the popup form in dialog mode (which is
probably already the case). In the popup form you need to add a public
property (Get) and assign it the desired value. Note: a form is just a
class module except that it has a graphical user interface (GUI - the
GUI thing happens way under the hood for Access).

In the popup you can create a public property anywhere in the Form's
code module (not a standard module or standalone class module). In my
sample I am setting a Certification property to a Long datatype. If
your Certification is a string, then set the property to String

'--code for popup form
Public Property Get Certification() As Long
Certification = CLng(txtCertification.value)
End Property

Private Sub cmdOK_Click()
Me.Visible = False
End Sub

In the popup form here I have a textbox called txtCertification. A user
enters information here then clicks an OK button (cmdOK) which only
hides (Me.Visible = False) the form (don't unload the form - it has to
be running so that you can read the value from its property). In the
calling form you would call the popup like this:

'--code for main form
Private Sub Command3_Click()
On Error Resume Next
DoCmd.Openform "frmPopup", acNormal, , , , acDialog, "test123"
Debug.Print Forms("frmPopup").Certification

End Sub

You can also pass a value to the popup using the openArgs property.
Here I pass "test123" to the popup. You can read the value in the popup
Load event

Private Sub Form_Load()
txtCertification = Me.OpenArgs
End Sub

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Oct 26 '07 #2
ARC
Assuming both forms have the same recordsource, all you have to do is make a
slightly different record source on the popup, where you will refer to the
main form.

For example, if the main form is called Customers, and has a hidden field on
it called CustomerID, then the recordsource for your popup form would be the
same as the original, however, add the field: CustomerID, and set critieria
to: forms!Customers.form!CustomerID

Hope this helps,

"CJONES" <cr******@hotmail.comwrote in message
news:11**********************@y42g2000hsy.googlegr oups.com...
>I have a main form with a combo box where if a specific customer is
selected a popup form opens and additional information required for
this customer is entered into the form. Data from the main form and
popup form is stored in the same table. I have a field called
certification that I would like to use to link the forms.
Oct 26 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Steven T. Hatton | last post by:
Is there anything that gives a good description of how source code is converted into a translation unit, then object code, and then linked. I'm particularly interested in understanding why putting...
3
by: Thomas Ruschival | last post by:
Hi, as far as I know I can link all C libraries in C++ as well. but I can't get it done with pslib. pslib is a library to create Postscript documents. The exactly same code compiles and links...
11
by: dskillingstad | last post by:
I've been struggling with this problem for some time and have tried multiple solutions with no luck. Let me start with, I'm a novice at Access and I'm not looking for someones help to design my...
2
by: Mike Boozer | last post by:
I have two subforms on my main form. I want the records on subform B to correspond with the records on subform A which they do. However, I want the records on subform A to let me know if there is a...
3
by: walkeraj | last post by:
I'm trying to compile an open source game called IVAN , and I'm able to compile it from a makefile, but not from an IDE. I have attempted to recreate the way the makefile compiles the project as...
2
by: SREDWORB | last post by:
Hello, Try to explain this as best as I can. I have a main form with several cmd buttons, (Not interested in subforms for this project) that opens popup forms. Example: Main form frmPerson,...
0
by: Mary | last post by:
I have a main form with one subform that is used to record test scores. The main form has the following fields: WratStudentID ( a combo box with 2 fields - student id and student name - . Stores...
3
by: TonyJH226 | last post by:
I’m using Access 2003 and am a novice to Access. I am creating a form to facilitate data entry to seven tables. The main table (A) has four sub-tables that are related to the main table by...
3
by: Robert McEuen | last post by:
Using A2K3, Windows XP I'm handling a many-to-many relationship with a linking table structure as follows (irrelevant fields omitted): tblIssue PK_IssueID (autonumber, primary key) IssueName...
2
by: rlamber | last post by:
Hello, I have 2 subforms in a Main form, one links fine, the other doesn't. I am trying to link them both to a "tracking ID" on the main form. The Tracking ID is a text field that is a combination...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.