?
Solved

MS Access VBA Filter

Posted on 2012-12-27
2
Medium Priority
?
387 Views
Last Modified: 2012-12-27
I have a subform which is linked on ClientID = CLientID parent to child

There is another field visitID in both parent and child (visitID)

I need a link on parent and subform where the parent visitID = child.visitID OR a NULL value.

Heres the reason...
The child table is a contacts history table and can have replicated contact's because they will on multiple visits over the years
0
Comment
Question by:lrbrister
[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
2 Comments
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 2000 total points
ID: 38723726
You can't really link with a NULL value, at least not directly with the Master/Child linking mechanism. Note you CAN include more than one field in the Master/Child links ... to do that, click on the build button in the Master Linkfield or the Child linkfield in the subform object's Property view. You can then select multiple fields to link on.

If you mean that you need to link on both (ClientID=ClientID and VisitID=VisitID) as well as ONLY (ClientID=ClientID), then I think you'll probably have to build the recordset for that yourself and set your subform's Recordsource directly, instead of relying on the builtin link mechanism. To do that, just use the Master form's Current event  to set the subform's Recordsource, somethnig like:

Me.YourSubformOBJECT.Form.Recordsource = "SELECT * FROM SomeTable WHERE (ClientID=" & Me.ClientID & " AND VisitID=VisitID) OR (ClientID=" & Me.ClientID & ")"
0
 

Author Closing Comment

by:lrbrister
ID: 38724365
Thanks
Watch for another question
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

777 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