Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Auto populate other fields based on a text box
Emma 

16 years ago
Hi,

I am a beginner level with database development Access 2007.

I am building a small database to record blood samples with information on the patient (some is public - used for reports, and some is private - contact info) and any types of drugs or alcohol (broken into antioxidants, illegal drugs, routine medications, herbals and alcohol) that they use and therefore affect the blood samples.

I have created a visit table, that gives the patient a unique visit code to link to the relevant history tables, and uses their patient ID to link to their public and private info. I then created a main form based on the visit table, with tabbed pages. on each tabbed page I have linked sub forms. (i created a sub from for each history and shows on the form in datasheet view)

The visit ID is the foreign key to all the history tables, what I would like to happen is when the user creates the visit ID for the patient, and then clicks on the alcohol tab, and goes to add a new record about their usage for this visit, that it will default to the visit ID that has just been entered. this way they dont have to keep re-entering the visit id to ensure that the historys match up with the patient and relevant visit and therefore relevant blood samples taken.

Is there a way to link it across multiple tabbed pages on one form

Thank you
Emma




Answer from Richard Rost:

If you have the VisitID on the main form, and then you have tabs with subforms on that form, then just set the Default Value of the ValueID on the subforms to:

=Forms!MainFormName!VisitID

This will set the value when data is first entered into a new record. See this tutorial for more help on this topic:

If you want to refer to a value on a Form, you can use the notation:

Forms!FormName!FieldName

You can use this notation inside of queries, other forms, or even reports. I have a free tutorial that explains how to use this:

http://599cd.com/tips/access/forms-formname-field-notation?key=BlFAlEx

Note that if you're refering to a value on a SUBFORM, the correct notation is:

Forms!FormName!SubForm.Form!FieldName

Crazy, I know. Enjoy! Hope this helps.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/31/2026 1:59:04 PM. PLT: 0s