Refering to a MVF from within a query (1 Viewer)

MvdBergh

New member
Local time
Today, 01:14
Joined
Apr 9, 2012
Messages
5
I’m working in the higher education environment. I have created a database (MS Access 2016) with access control for multiple users all over different faculties. The table I use is “AfterStartup” of which I’m using a multivalued field (MVF) “School” from where access to different schools are pre-selected per user. (This is linked to a Logon screen).

I need users to run financials reports for their selected schools from which the data is obtained from:

Table: Debtors_Summary​
Field: Dr_School​
Other fields: InvNumber, DrAmnt, CrAmnt​

The idea is to have only the schools’ information queried to which the users have access to as per MVF “School”.

The problem is when building the criteria with the expression builder to retrieve the "Dr_schools" from the MVF “School” from the table “AfterStartup”, I get no results unless I manually enter a string as 1 AND 2 AND 3.

I have read many posts on this and it seems I’ll have to write a search string.

I need assistance in writing such a search string or an alternative as to how to retrieve MVF fields in a query.
 
Last edited:

Ranman256

Well-known member
Local time
Today, 04:14
Joined
Apr 9, 2015
Messages
4,337
i would not use MVF, but rather, subtables. Easier to manage.
 

jdraw

Super Moderator
Staff member
Local time
Today, 04:14
Joined
Jan 23, 2006
Messages
15,380
If you research MVF you will often be referred to this link.
For most applications MVFs are not a first choice option because of what they do behind the scenes.
Better to restructure your table and use appropriate "lookup tables" and traditional queries/sql.
 

MvdBergh

New member
Local time
Today, 01:14
Joined
Apr 9, 2012
Messages
5
jdraw. Thank you. I have realised the issues the more and more I have searched for an answer and found that is not advised. I'll address future development with subtables as you have suggested. Thank you for the link provided. I'll investigate accordingly.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 16:14
Joined
May 7, 2009
Messages
19,247
On your query add the school tsble coz this is yhe lookup table.
Still on ur query add the school.Value not the "school" field from afterstartup or whichever tabke you have to query.
School.value will automatically link to the school.id.
In your query add the school name field or whatever info you need from main school table.
 

Users who are viewing this thread

Top Bottom