dbTalk Databases Forums  

qry based on user

comp.databases.ms-access comp.databases.ms-access


Discuss qry based on user in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
donh
 
Posts: n/a

Default qry based on user - 01-21-2011 , 05:27 AM






Hi,

Using Access 2003. Limited Knowledge. I have a db that has a self
made login screen (not created via security) with drop down user
selection Maintenance, Nursing, Housekeeping. Currently all the drop
down does is provide criteria used to direct user to appropriate
switchboard. Is there an EASY way of being able to keep the session
user information available for use in a query? At present I'm using
different quiries and sometimes forms for each of the user groups
which is leading to a bloated DB. Any tips and advice woulds be very
welcome.

Thanks in anticipation

DonH

Reply With Quote
  #2  
Old   
XPS350
 
Posts: n/a

Default Re: qry based on user - 01-21-2011 , 06:12 AM






On 21 jan, 12:27, donh <donhar... (AT) gmail (DOT) com> wrote:
Quote:
Hi,

Using Access 2003. Limited Knowledge. *I have a db that has a self
made login screen (not created via security) with drop down user
selection Maintenance, Nursing, Housekeeping. *Currently all the drop
down does is provide criteria used to direct user to appropriate
switchboard. *Is there an EASY way of being able to keep the session
user information available for use in a query? *At present I'm using
different quiries and sometimes forms for each of the user groups
which is leading to a bloated DB. *Any tips and advice woulds be very
welcome.

Thanks in anticipation

DonH
If you do not close the login screen, you refer to the form from
queries.

If not, you could store the user name in a table containing only one
record (using the after update event of the user field on the login
form).. In queries you can use a DLoopUp to obtain the current user.

Groeten,

Peter
http://access.xps350.com

Reply With Quote
  #3  
Old   
donh
 
Posts: n/a

Default Re: qry based on user - 01-21-2011 , 06:30 AM



On Jan 21, 12:12*pm, XPS350 <xps... (AT) gmail (DOT) com> wrote:
Quote:
On 21 jan, 12:27, donh <donhar... (AT) gmail (DOT) com> wrote:

Hi,

Using Access 2003. Limited Knowledge. *I have a db that has a self
made login screen (not created via security) with drop down user
selection Maintenance, Nursing, Housekeeping. *Currently all the drop
down does is provide criteria used to direct user to appropriate
switchboard. *Is there an EASY way of being able to keep the session
user information available for use in a query? *At present I'm using
different quiries and sometimes forms for each of the user groups
which is leading to a bloated DB. *Any tips and advice woulds be very
welcome.

Thanks in anticipation

DonH

If you do not close the login screen, you refer to the form from
queries.

If not, you could store the user name in a table containing only one
record (using the after update event of the user field on the login
form).. In queries you can use a DLoopUp to obtain the current user.

Groeten,

Peterhttp://access.xps350.com
Peter,

Thank you for your reply, I shall give that a try

Many thanks DonH

Reply With Quote
  #4  
Old   
Salad
 
Posts: n/a

Default Re: qry based on user - 01-21-2011 , 12:50 PM



donh wrote:
Quote:
Hi,

Using Access 2003. Limited Knowledge. I have a db that has a self
made login screen (not created via security) with drop down user
selection Maintenance, Nursing, Housekeeping. Currently all the drop
down does is provide criteria used to direct user to appropriate
switchboard. Is there an EASY way of being able to keep the session
user information available for use in a query? At present I'm using
different quiries and sometimes forms for each of the user groups
which is leading to a bloated DB. Any tips and advice woulds be very
welcome.

Thanks in anticipation

DonH
A possibility. Let's say you have a main form that always stays open.
You could create a textbox field with the Name property set to FormUser
in that form, doesn't have to be the form that selects the user, just
one that stays open. Then set the Visible property to False.

In the AfterUpdate event of the combo you could enter
Form!TheNameOfFormWithTextbox!FormUser = Me.ComboboxName
If the dropdown is multi-column you might do
Form!TheNameOfFormWithTextbox!FormUser = Me.ComboboxName.Column(n)

You would substitute "TheNameOfFormWithTextbox" with the name of the form.

Now in your query builder you can refer to
Form!TheNameOfFormWithTextbox!FormUser

Of course, you'd want to set the textbox first before opening the form
that uses the query.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.