By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,660 Members | 1,082 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,660 IT Pros & Developers. It's quick & easy.

Filter info by who logs in.

P: 56
I have a database and I am using a function that captures the shortname and displays it on the mainMenu screen.

What I want to do is filter the information on the "past due" screen based on the person who has just open the database so that they can see just their items.

The shortname is stored in a table called "TShortNames" The shortname ties to an 4 character "Opid". This same "opid' is in the main "TARA" table that stores all the infomation.

What I would like to happen is from the main screen when they click on "PastDue" it will on a Mainform\Subform.
The user would click on "Option1" and a the opid control in the main form will appear and show that users opid and already have the subform filtered to just show their items. Then they could continue to filter by additonal combo boxes.

Right now they have to select there opid and then keep selecting from additional combo boxes. Example if I open the datebase clicked on past due and clicked the first option. The subform will become visible and the combo box would show "HH01" and it would show that I had 5 items that I need to work.

Attached is a demo to show what I currently have and to see if what I am asking is possible.
Jan 10 '07 #1
Share this Question
Share on Google+
5 Replies


P: 36
Why just make a subform form TARA then use Opin as Mother and Child link ID?

HTH,
George

I have a database and I am using a function that captures the shortname and displays it on the mainMenu screen.

What I want to do is filter the information on the "past due" screen based on the person who has just open the database so that they can see just their items.

The shortname is stored in a table called "TShortNames" The shortname ties to an 4 character "Opid". This same "opid' is in the main "TARA" table that stores all the infomation.

What I would like to happen is from the main screen when they click on "PastDue" it will on a Mainform\Subform.
The user would click on "Option1" and a the opid control in the main form will appear and show that users opid and already have the subform filtered to just show their items. Then they could continue to filter by additonal combo boxes.

Right now they have to select there opid and then keep selecting from additional combo boxes. Example if I open the datebase clicked on past due and clicked the first option. The subform will become visible and the combo box would show "HH01" and it would show that I had 5 items that I need to work.

Attached is a demo to show what I currently have and to see if what I am asking is possible.
Jan 11 '07 #2

P: 56
Why just make a subform form TARA then use Opin as Mother and Child link ID?

HTH,
George
It's a little more complicated than that. because I still want them to be able to select another person's opid if that person is not in and they need to do their work.

Is there a way to tie a sql statement and Dlookup together?

strSQL = "TARA.NetC=0 "
Me.CboOpid = DLookup("[Opid]", "TShortNames", "[ShortName] = FOSUserName()")

Can the two statements above be combined?
Jan 11 '07 #3

P: 56
I have a Mainform called "MainPastDue" and a Subform called "PastDues". Currently when the user logs in they open the Mainform and click on an Option button and a combo box appears where they can select their name and it will filter the data in the subform based on there name.

I wanted to automate this process.

I created a table that stores their "ComputerName" and the uers name. What I would like to happen is to take the computer name look up the user's name that maps to the computer name and when they click on option one filter the data automatically to show only their items instead of them having to select their name.

Here is the code on the Afterupdate of Option 1:

Expand|Select|Wrap|Line Numbers
  1. Dim linker
  2. Dim strSQL As String
  3. linker = Frame95.Value
  4. Select Case linker
  5.         Case 0
  6.         ittype = 0
  7.         Me.Cmdclose.SetFocus
  8.         Me.FPastDues.Form.FilterOn = False
  9.         strSQL = "TARA.NetC=0"
  10.         FPastDues.Visible = True
  11.         Me.FPastDues.Form.Filter = strSQL
  12.         Me.FPastDues.Form.FilterOn = True
What I am trying to add is this:
Expand|Select|Wrap|Line Numbers
  1. Me.CboName = DLookup("[EmployeeName]", "TShortNames", "[ShortName] = FOSUserName()")
Me.CboName - is the combo box where they currently select their name.
TshortNames -is the table that stores the computer name and their name
FOSUserName- is the function I am using to capture the computer name

The Mainform and Subform record source is using another table that has the empolyee's name and I need to somehow say after it finds the Employee name match it to name int he main table and refilter the info.
Jan 11 '07 #4

NeoPa
Expert Mod 15k+
P: 31,271
You're not making much sense here.
Is "TARA.NetC=0" part of the Filtering?
Are you looking for something like :
Expand|Select|Wrap|Line Numbers
  1. Me!OpID=DLookup("[OpID]","TShortNames","(([ShortName]=' & FOSUserName() & "') AND (TARA.NetC=0))")
Jan 12 '07 #5

NeoPa
Expert Mod 15k+
P: 31,271
As it seems you've asked this question before I'm going to join the two threads.
No-one wants to answer the same question twice.
Let us know if your question is not adequately answered.
Jan 12 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.