T
Todd
I have a form which contains a combo box that allows my
users to enter which Shift they are on, which is saved
with each status record that they enter.
I have a table that looks like this.
Shift User
A Bill
B Ted
C Mark
A Betty
A Jen
C Fred
Right now the way the combo box is setup, the rowsource
contains a query which returns the different shift letters
as choices in the combo box.
What I want to do is make it so that the default value for
the combo box is the users normal shift (ie per the
table). Each users database username is the same as the
value in this table so I'm hoping I can use the CurrentUser
()function, compare it to the values in this table, and
return the default value as the correct shift per the
table. I want to keep the combo box format, because
occasionally people work different shifts, so I still want
them to have the option to change the shift entry.
Can anyone help with this? Although I know how to write
the query to do this, I can't seem to make a query work
for the default value.
The query that works is:
SELECT [ShiftList].[Shift] FROM [ShiftList] WHERE
(((CurrentUser())=[ShiftList].[User]));
users to enter which Shift they are on, which is saved
with each status record that they enter.
I have a table that looks like this.
Shift User
A Bill
B Ted
C Mark
A Betty
A Jen
C Fred
Right now the way the combo box is setup, the rowsource
contains a query which returns the different shift letters
as choices in the combo box.
What I want to do is make it so that the default value for
the combo box is the users normal shift (ie per the
table). Each users database username is the same as the
value in this table so I'm hoping I can use the CurrentUser
()function, compare it to the values in this table, and
return the default value as the correct shift per the
table. I want to keep the combo box format, because
occasionally people work different shifts, so I still want
them to have the option to change the shift entry.
Can anyone help with this? Although I know how to write
the query to do this, I can't seem to make a query work
for the default value.
The query that works is:
SELECT [ShiftList].[Shift] FROM [ShiftList] WHERE
(((CurrentUser())=[ShiftList].[User]));