UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Set query criteria according to who logged in    
 
   
sunspirits
post Nov 11 2004, 12:57 PM
Post #1

New Member
Posts: 1



I believe I have a mental block on this right now.
The situation is as follows:
The database is secured with multiple users that log in. Certain users open only certain items. There is a report "Signoff Sheets by Crew" that outputs all the hourly workers for all of the crews according to what the date input the foreman enters. This report is tied to a query "Signoff Sheets by Crew Query". The query uses the following tables "Crew_Table" which has the "Supervisor" field and "OT Signup" table which has the "Crew" field. I want to split it up so that when the user clicks on the button to open the form it automatically sets what crew he needs to see. I still need it to ask what the date is, but would like the crew to be set with some type of function in code or whatever works best. I have tried a few ways but I think I am way off.

Also, I know this maybe simple but I do have a mental block, I have yet to figure out how to use a function correctly in the query criteria. I am not sure what the syntax is for that.

Thanks!
Go to the top of the page
 
+
wen
post Nov 12 2004, 11:52 AM
Post #2

UtterAccess Addict
Posts: 153
From: The Netherlands



Do something like

SELECT * FROM tblData WHERE isallowed([columnwithaccesscode])=True;

in your query

and use a function similar to

Function IsAllowed(ByVal sACE As String) As Boolean
If sACE = "allow" Then
IsAllowed = True
End If
End Function

You use a function (almost) like any other literal value.
E.g.
SELECT * FROM tblData WHERE column = 123;
is similar to
SELECT * FROM tblData WHERE column=ThisFunctionReturns123();

HTH, Wen
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 23rd May 2013 - 05:33 AM