Some questions regarding combo boxes

Badnapp

Registered User.
Local time
Today, 18:47
Joined
Dec 16, 2013
Messages
42
Hello everybody,

I have a small database law clerks use to track their weekly tasks. The first form "Login" has two comboboxes, one cboFullName that references a table with EmpID, FullName, Region, and Password and cboPassword that verifies the employee's password.

When the employee presses a button this form minimizes and they are brought to the next form which is "Task List" that is linked to a table "tasks." From here they can press another button "New Task" which brings them to the form "Task Details" where they can put in any relevant information about a task. They then press another button which saves this entry as a record which they view using the "Task List" form because it is split and allows easy editing. I have a text box on the "Task List" form which I use to display the name of whoever is logged in and restrict the records that they can view.

I would like to be able to autopopulate two combo boxes on the "Task Details" form based on the user who is logged on.

Example:

John Smith logs into database at Login Form
John Smith clicks New Task at "Task List" Form
John Smith is brought to the "Task Details" form, where his name and region are already selected for him in their relevant combo boxes.
John Smith saves the current record, and it is displayed in his "Task List"

How would I go about making this happen? I might not have explained perfectly so please ask for clarification if you need it.
 
This worked perfectly for me. Thank you for your assistance.

If I could trouble you for one more minor thing. What can I add to the query or SQL lines in order to automatically select the available option.

IE. Now that I based my comboboxes on that query they will only populate with who is logged on at the moment, is there a way to load those names as the form opens, so the clerk does not have to click the combo box and select their name & region even though there is only one available option now for each box?

Maybe something like SELECT "queryname" Row 1 or something like that on form open?
 
One way is to have all the values you need as hidden textboxes on your main menu.
Never allow this menu to close unless you exit the db and it will always be available to you.

So you have your login form, when they successfully login set these hidden values to the various values associated with the user.
You could use DLOOKUPs or set Globals.

Now any queries can use the values based on the Main Menu so when you open a subsequent Form based on a Query the user doesn't have to select anything as it's already got the Parameters and will auto load.
 
Thanks for your help :)

I was able to get it to work by using this query:

SELECT tblUser.FullName, tblUser.Region, tblUser.UserID
FROM tblUser
WHERE (((tblUser.FullName)=[Forms]![frmLogin]![cboUser]));

... and then basing combo boxes off of the query. The login window minimizes when they put in the correct username and password, which enables me to still reference the values until they log out or close the session. It seems to work ok :) I'm glad I figured this out
 

Users who are viewing this thread

Back
Top Bottom