Avatar of mbmartin0409
mbmartin0409Flag for United States of America

asked on 

Access 2010: Link subform history to current record when ID numbers are different

In my access DB i have a subform from a history file of actions.  The primary key (callID) is linked to an old ID number (OldID) contained in a table, tblInquiryFile.  The current record in the input form comes from a new ID number in that table,  [ID].  currently, the subform history shows all records in the history table.  I only want it to show those where there is a match between the oldIDs Can anyone help with language that would return to the subform the current record and history for that record where the oldIDS match?  I'm guessing it would require some kind of selection based on a combination of multiple id fields.  help?
DatabasesMicrosoft ApplicationsMicrosoft Access

Avatar of undefined
Last Comment
mbmartin0409
Avatar of lee555J5
lee555J5
Flag of United States of America image

In design view, select the subform container. Make sure you select the container and not in the subform itself. In the properties window you should see these 2 properties: Link Master Fields and Link Child Fields. See my attached image. In your db, do these have data?
MS-Access-2010-subform-link-fiel.png
Avatar of mbmartin0409
mbmartin0409
Flag of United States of America image

ASKER

Hi Lee - Yes - there is a lot of data. 18,000 records in tblInqiryFile (what the current form should be returning and is on the main tab of the form and 65000 call history records (from tblcalls) for those in the subform.  All calls are currently showing in the subform.
Avatar of mbmartin0409
mbmartin0409
Flag of United States of America image

ASKER

Responding again --- You definitely pointed me in the right direction!  --- I  successfully linked the call table to the current record on the form using the master and child fields.   BUT --- since those linked ID's are "old ones" - and not new ones, I can't add a new call record to the file.  I'm getting the following error: "Index or primary key cannot contain a null value" --- this is happening, i think, because to show this history i'm linking the current record of the primary input form to the subform via "oldInquiryID" from the underlying primary table with the "OldInquiryID" from the subform underlying table "tblcallhistory" .... those numbers are just numbers.  the New ID, [ID] in tblInquiryFIle is the primary key of that table and [callID] is the primary key of the subform table, tblcallhistory.  

Now what? :-)

You've been helpful to this point immensely --- hopefully we can resolve this!
Michael.
ASKER CERTIFIED SOLUTION
Avatar of lee555J5
lee555J5
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of mbmartin0409
mbmartin0409
Flag of United States of America image

ASKER

It's ok --- you pointed me to the right place last night.  It's all working now!!   --- well mostly :-) ---    Now i'm I'm on a new path to find out if I can use a button on my Access Form to Open Outlook Calendar when an appointment is made..........  

thanks for your help!!
Michael
Microsoft Access
Microsoft Access

Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.

226K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo