Old Access hand unable to set 2013 Web App query criteria from a View

PeteKent

New member
Local time
Today, 12:19
Joined
Sep 22, 2015
Messages
1
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
 
Hi

To be honest, I am not at all sure that this is possible...

As a point of principle though, using a query as a rowsource for a combo box will require the query to be able to get everything it needs from the back end. One thing you could try is to save the ID of the current record to a table using a data macro and then using this table as part of the row source query.

I haven't tried this - and thinking about it you could run into timing issues (i.e. is the data stored before the queery runs or after. In this case you may need to use a require records action - just thinking aloud...

Hope this idea helps - and I would be interested to know how you get on.:)
 

Users who are viewing this thread

Back
Top Bottom