Senin, 19 Agustus 2019

[MS_AccessPros] Re: link child/master field on subreport

 

Hi Sarah


As you've discovered, you cannot link two fields when they are both Null, because technically Null does not equal Null - the relationship between them is undefined.

However, you can use the Nz() function to convert the Null to something else - even a zero-length string (ZLS) - for the purpose of matching.

(I understand "table" is the master field and "shift" is the child field, right?  If it's the other way around, just switch the names below.)

On your main form, add a hidden textbox named txtTableLink with 
ControlSource: =Nz([table],"")

To the RecordSource query of your subform, add a field: 
txtTableLink: Nz([shift],"")
If your RecordSource is a table, then create a query based on that table with this additional field.

Now set both the LinkMasterFields and LinkChildFields properties of the subform to txtTableLink

(Note that LinkMasterFields can be a field OR a control, but LinkChildFields must be a field - hence the need to add it to the RecordSource.

Best wishes,
Graham [Access MVP 1996-2016]

__._,_.___

Posted by: graham@mandeno.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (3)

.

__,_._,___

Tidak ada komentar:

Posting Komentar