Query result for Default value in form

1972Chevelle

New Member
Joined
Jun 20, 2014
Messages
2
I have a user table that I use in a Login Form. Once the user has logged in they have access to various forms. I have a query that returns the current user logged in. I would like to populate the default value in the combo box. I have been able to populate the default value with the form value from [forms]![frmlogin]![cboUser] but that only returns the ID from the table and not the field I want which is the username. I can run a query on the user table and filter with the same [forms]![frmlogin]![cboUser] and I can return the logged in user but then I am trying to populate this into the default value of the combo box.

The databases is to track downtime on my equipment. Sometimes the the logged in user is not the user that is entering the data so they need to be able to select the correct user if they are not the logged in user at that moment in time.

Anyone have any ideas on how I can do this?

Gary
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Hmm, not sure but I think you are looking for...

[Forms]![frmlogin]![cboUser].Column(1)

The above is assuming the UserName is in the 3 column of the Combo Box.
 
Upvote 0

Forum statistics

Threads
1,215,459
Messages
6,124,947
Members
449,198
Latest member
MhammadishaqKhan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top