Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2014-01-09
1
Medium Priority
?
650 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

660 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