Hi,
I'm an old Access hand who's going nuts trying to pass the ID of a View/Form for use as the criteria to a query which is used as the source of a lookup on the View/Form. I've read Jeff Conrad's excellent book but I'm still stuck. Here's what I want to do.
1. View Member has various fields, MemberID (control name txtMemberID), cboNextOfKin, etc...
2. cboNextOfKin is a combo in View Member whose rowsource is qryMemberFullName (i.e. MemberID, FullName, etc)
I need to set a criteria on qryMemberFullName to exclude the currently selected Member. So in legacy Access I might simply set the criteria under query field MemberID as '<> frmMember!txtMemberID' or something similar and I understand the reasons why this is not appropriate.
Here's what I've tried:
Created a data macro dm_GetCurrentMemberID with a parameter named ParamCurrentMemberID of type Number (No Dec).
Created an embedded macro in the View member 'On Current' event with a RunDataMacro Action that uses the data macro dm_GetCurrentMemberID but although I've tried many combinations, I can't correctly define the criteria link to my query. Defining the query as a parameterized query is obviously not enough and the OpenPopup option is not useful in this context.
I'm clearly overlooking something very obvious so could someone please set it out simply for me?
Thanks
I'm an old Access hand who's going nuts trying to pass the ID of a View/Form for use as the criteria to a query which is used as the source of a lookup on the View/Form. I've read Jeff Conrad's excellent book but I'm still stuck. Here's what I want to do.
1. View Member has various fields, MemberID (control name txtMemberID), cboNextOfKin, etc...
2. cboNextOfKin is a combo in View Member whose rowsource is qryMemberFullName (i.e. MemberID, FullName, etc)
I need to set a criteria on qryMemberFullName to exclude the currently selected Member. So in legacy Access I might simply set the criteria under query field MemberID as '<> frmMember!txtMemberID' or something similar and I understand the reasons why this is not appropriate.
Here's what I've tried:
Created a data macro dm_GetCurrentMemberID with a parameter named ParamCurrentMemberID of type Number (No Dec).
Created an embedded macro in the View member 'On Current' event with a RunDataMacro Action that uses the data macro dm_GetCurrentMemberID but although I've tried many combinations, I can't correctly define the criteria link to my query. Defining the query as a parameterized query is obviously not enough and the OpenPopup option is not useful in this context.
I'm clearly overlooking something very obvious so could someone please set it out simply for me?
Thanks