I currently working on a db for entering information based on a quote
system.
On the form I need to display some averages for user performance.
I need to display the usernames and the average 'hour" value for total
completed jobs. I have the correct time value being calculated by using
Brent's code and then seperatly calculating the hours and minutes.
I'm then calculating the average of the total for the users based on the
UserId.
The query I have and need to display for all the users is;
Username Average
Joe Smith 9.7
Jim Johns 7
Sue reynolds 8.2
I won't be displaying field descriptions, just the name & average. Your
help
made the first item display perfect. I would like to use the combo box to
display these records.
Here is the query data for one user;
SELECT t.UserID, t_User.UserName, Avg(t.Total_Hours) AS AvgOfTotal_Hours
FROM q_TotalWorkTime AS t INNER JOIN t_User ON t.UserID = t_User.UserID
GROUP BY t.UserID, t_User.UserName
HAVING (((t.UserID)=1));
Thanks so much!
Douglas J. Steele said:
Sorry, you'll have to give some more details. I don't understand what
you're
trying to do.
--
Doug Steele, Microsoft Access MVP
(no private e-mails, please)
How would I add multiple instances (different Id) to the form load
event?
I have a few users I'm calc. job time against. Can I place similair
lines
of
code in the vba?
Thank you so much! I've been struggling with this total time display
for a
bit. It takes quite, a bit at least fora beginner, to get the accurate
workdays, hrs, min, and all that good stuff.
Now I can move on to more good stuff...
Thank you,
:
You need to use VBA.
Set the property to [Event Procedure], then click on the ellipsis
(...)
to
the right of the property. That should take you into the VB Editor, in
the
middle of text like
Private Sub Form_Load
End Sub
Put that line of code in between those two lines.
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
I placed this in the forms event "on Load" Me.cboAvg1 =
Me.cboAvg1.ItemData(0)
When I reload the form, I get this message;
Microsoft cannot find the object Me
Do I need to add something to the Visual basic Library MQL?
Thanks,
:
Is the combo box bound to a field in the form's RecordSource? An
unbound
combo box, by default, doesn't show any data.
If it is unbound and you need to make it select the first value,
the
following code will do it:
Me.Combo0 = Me.Combo0.ItemData(0)
Replace "Combo0" with the actual name of your combo box.
This code can go in the form's Load event.
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
I have searched for this and could'nt find the answer I'm in need
of,
so
here
is my question.
I'm using Access 2007 and have a combo box referencing a query.
The
correct
result is showing up in the combo box, but the first "row" is
blank.
I
need
the combo box first row to show the results.
If I run the query that it's referencing, there is no blank first
row.
Example of row source;
SELECT [q_UserAvgId1].[UserID], [q_UserAvgId1].[UserName],
[q_UserAvgId1].[AvgOfTotal_Hours] FROM [q_UserAvgId1] ORDER BY
[UserName];
Thanks,