Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How populate 2nd form opened with value from selected record in 1st form

Posted on 2014-01-09
1
Medium Priority
?
652 Views
Last Modified: 2014-01-09
I have a form which has a subform.  On the subform is a numeric field named ID.  This field is a hyperlink.  When the user clicks it a 2nd form opens.  On this 2nd form is a field also named ID.  I want the value of the field on the 2nd form to be the same value as the ID field on the 1st form (subform).

But it has to get the value from the SELECTED record on the 1st form.

I have this in the default value of the 2nd form but it isn't working because its not using the selected record.  How do I fix this?

=[Forms]![subfrmPets]![txtID]
0
Comment
Question by:SteveL13
1 Comment
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 39768283
change this

=[Forms]![subfrmPets]![txtID]

with

=[Forms]![NameOFMainForm]![subfrmPets].form![txtID]


or if the name of the subform control is not "subformPets", use

=[Forms]![NameOFMainForm]![Nameof subfrmPets Control].form![txtID]
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

876 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question