Don
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
passing variable between forms (Access 2000)
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » passing variable between forms (Access 2000)
- This topic has 12 replies, 4 voices, and was last updated 21 years, 1 month ago.
AuthorTopicWSMichaelpeak
AskWoody LoungerMay 19, 2004 at 2:10 pm #405135Viewing 3 reply threadsAuthorReplies-
WSdazednconfused
AskWoody LoungerMay 19, 2004 at 2:21 pm #829417I’m not 100% sure I understand teh question, but here’s a stab at an answer.
The line of code to open a form as an option to use ‘openargs’. This could be set to PersonID. Then the form opens you use the openargs value to control the forms recordset.
Depending on how you are controlling the recordset this might be easy, it might not be.
open args is the last option on the DoCmd.OpenForm FormName, etc, etc, etc line of code.
Hope this is what you were after
Ian
-
WSdazednconfused
AskWoody LoungerMay 19, 2004 at 2:21 pm #829418I’m not 100% sure I understand teh question, but here’s a stab at an answer.
The line of code to open a form as an option to use ‘openargs’. This could be set to PersonID. Then the form opens you use the openargs value to control the forms recordset.
Depending on how you are controlling the recordset this might be easy, it might not be.
open args is the last option on the DoCmd.OpenForm FormName, etc, etc, etc line of code.
Hope this is what you were after
Ian
-
WSHansV
AskWoody Lounger -
WSMichaelpeak
AskWoody LoungerMay 19, 2004 at 6:25 pm #829582Thanks very much it worked! – it picked up the PersonID perfectly
Another snag it only works if the form was the actual form and NOT a subform, I’m afraid it has to be.
So if I just open that form (it’s called members) then it works. But if I open Household of which members is now a page on a tabbed subform, I get the message cannot find form Members.
If I change the name to Household, then it say can’t find personID
I do appreciate your help on a real stumbling block on this database
Michael
-
WSbushaw
AskWoody LoungerMay 19, 2004 at 6:36 pm #829586If your Print button is on your Household parent form and your personID is on your Members subform then you can reference the subform field using something like Me!subformName.Form!personID or from somewhere else (if the Household form is still open) using something like Forms(“Household”)!subformName.Form!personID. Note that ‘subformName’ is not necessarily the name of the subform itself (Members), but rather the name of the subform control on the parent form (Household).
Hope this helps.
-
WSbushaw
AskWoody LoungerMay 19, 2004 at 6:36 pm #829587If your Print button is on your Household parent form and your personID is on your Members subform then you can reference the subform field using something like Me!subformName.Form!personID or from somewhere else (if the Household form is still open) using something like Forms(“Household”)!subformName.Form!personID. Note that ‘subformName’ is not necessarily the name of the subform itself (Members), but rather the name of the subform control on the parent form (Household).
Hope this helps.
-
WSHansV
AskWoody LoungerMay 19, 2004 at 6:56 pm #829614In addition to Tom’s informative reply, you can find a comprehensive overview of how to Refer to Form and Subform properties and controls on the Access Web (and you’ll find lots of other useful information there.)
-
WSMichaelpeak
AskWoody LoungerMay 19, 2004 at 9:14 pm #829772Guys,
Its working!!!!
I can open and close the Print menu form using the code Hans gave this morning and I can print reports from the details of person on the sub form using this code from Tom and Hans:-
Private Sub CmdPersonalInvestments_Click()
On Error GoTo Err_CmdPersonalInvestments_ClickDim stDocName As String
stDocName = “RptPersonalInvestments”
DoCmd.OpenReport stDocName, acPreview, , “[PersonID]= ” & Forms(“Household”)![Members].Form!PersonIDExit_CmdPersonalInvestments_Click:
Exit SubErr_CmdPersonalInvestments_Click:
MsgBox Err.Description
Resume Exit_CmdPersonalInvestments_ClickEnd Sub
Its been very frustating day – everthing worked I had just no room for the print options on the form
With your help its now sorted, I’ve learnt a lot and I’m very grateful.
Thanks a million
Michael
Ps and thank for pointing me to the Access web
M -
WSMichaelpeak
AskWoody LoungerMay 19, 2004 at 9:14 pm #829773Guys,
Its working!!!!
I can open and close the Print menu form using the code Hans gave this morning and I can print reports from the details of person on the sub form using this code from Tom and Hans:-
Private Sub CmdPersonalInvestments_Click()
On Error GoTo Err_CmdPersonalInvestments_ClickDim stDocName As String
stDocName = “RptPersonalInvestments”
DoCmd.OpenReport stDocName, acPreview, , “[PersonID]= ” & Forms(“Household”)![Members].Form!PersonIDExit_CmdPersonalInvestments_Click:
Exit SubErr_CmdPersonalInvestments_Click:
MsgBox Err.Description
Resume Exit_CmdPersonalInvestments_ClickEnd Sub
Its been very frustating day – everthing worked I had just no room for the print options on the form
With your help its now sorted, I’ve learnt a lot and I’m very grateful.
Thanks a million
Michael
Ps and thank for pointing me to the Access web
M
-
-
-
WSHansV
AskWoody LoungerMay 19, 2004 at 6:56 pm #829615In addition to Tom’s informative reply, you can find a comprehensive overview of how to Refer to Form and Subform properties and controls on the Access Web (and you’ll find lots of other useful information there.)
-
WSMichaelpeak
AskWoody LoungerMay 19, 2004 at 6:25 pm #829583Thanks very much it worked! – it picked up the PersonID perfectly
Another snag it only works if the form was the actual form and NOT a subform, I’m afraid it has to be.
So if I just open that form (it’s called members) then it works. But if I open Household of which members is now a page on a tabbed subform, I get the message cannot find form Members.
If I change the name to Household, then it say can’t find personID
I do appreciate your help on a real stumbling block on this database
Michael
WSHansV
AskWoody LoungerViewing 3 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Very Quarrelsome Taskbar!
by
CWBillow
5 hours, 51 minutes ago -
Move OneNote Notebook OFF OneDrive and make it local
by
CWBillow
8 hours, 35 minutes ago -
Microsoft 365 to block file access via legacy auth protocols by default
by
Alex5723
9 hours, 54 minutes ago -
Is your battery draining?
by
Susan Bradley
8 minutes ago -
The 16-billion-record data breach that no one’s ever heard of
by
Alex5723
11 hours, 51 minutes ago -
Weasel Words Rule Too Many Data Breach Notifications
by
Nibbled To Death By Ducks
12 hours, 27 minutes ago -
Windows Command Prompt and Powershell will not open as Administrator
by
Gordski
15 hours, 42 minutes ago -
Intel Management Engine (Intel ME) Security Issue
by
PL1
6 hours, 25 minutes ago -
Old Geek Forced to Update. Buy a Win 11 PC? Yikes! How do I cope?
by
RonE22
21 minutes ago -
National scam day
by
Susan Bradley
11 hours, 52 minutes ago -
macOS Tahoe 26 the end of the road for Intel Macs, OCLP, Hackintosh
by
Alex5723
1 minute ago -
Cyberattack on some Washington Post journalists’ email accounts
by
Bob99
1 day, 13 hours ago -
Tools to support internet discussions
by
Kathy Stevens
2 hours, 12 minutes ago -
How get Group Policy to allow specific Driver to download?
by
Tex265
1 day, 4 hours ago -
AI is good sometimes
by
Susan Bradley
1 day, 20 hours ago -
Mozilla quietly tests Perplexity AI as a New Firefox Search Option
by
Alex5723
1 day, 10 hours ago -
Perplexity Pro free for 12 mos for Samsung Galaxy phones
by
Patricia Grace
2 days, 21 hours ago -
June KB5060842 update broke DHCP server service
by
Alex5723
2 days, 19 hours ago -
AMD Ryzen™ Chipset Driver Release Notes 7.06.02.123
by
Alex5723
2 days, 23 hours ago -
Excessive security alerts
by
WSSebastian42
1 day, 14 hours ago -
* CrystalDiskMark may shorten SSD/USB Memory life
by
Alex5723
3 days, 9 hours ago -
Ben’s excellent adventure with Linux
by
Ben Myers
1 hour, 57 minutes ago -
Seconds are back in Windows 10!
by
Susan Bradley
2 days, 20 hours ago -
WebBrowserPassView — Take inventory of your stored passwords
by
Deanna McElveen
1 day, 13 hours ago -
OS news from WWDC 2025
by
Will Fastie
23 hours, 54 minutes ago -
Need help with graphics…
by
WSBatBytes
2 days, 4 hours ago -
AMD : Out of Bounds (OOB) read vulnerability in TPM 2.0 CVE-2025-2884
by
Alex5723
4 days ago -
Totally remove or disable BitLocker
by
CWBillow
2 days, 23 hours ago -
Windows 10 gets 6 years of ESU?
by
n0ads
3 days, 2 hours ago -
Apple, Google stores still offer China-based VPNs, report says
by
Nibbled To Death By Ducks
4 days, 11 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.