What format do you show your dates?
"#" & Me.txtDate & "#" will be interpreted as #mm/dd/yyyy# so if you use dd/mm/yyyy, it will fail when the day of the month is between 1 and 12 (and the day number <> month number)
If the dlookup doesn't find a match, the answer will not be 0, I think it'll be null
Therefore, change the second line of your code to
If isnull(DLookup("user", "tbluser", "User='" & Environ("username") & "'")) Then
Assuming there was no more than 1 in and out on the same day, you could use a crosstab query, eg.
TRANSFORM First(TimeValue([datetime])) AS InOutTime
SELECT tbl_Attendance.EmployeeID, DateValue([datetime]) AS InOutDate
FROM tbl_Attendance
GROUP BY tbl_Attendance.EmployeeID...
Thanks again for the replies.
I've added the code as suggested by Chris0 and it does exactly as I need.
Note sure I understand why this draws the box behind the subreport when my original experience was that the box was drawn over the subreport and I've unfortunately deleted my previous code...
Thanks again for the replies and apologies for the delay replying.
I've attached 2 example screenshots, CurrentReport.png which is how my current report looks and DesiredReport.png which is how I would like it to look, if possible.
The colour & size info comes from a subreport which 'can...
I imagine that, as you have it, the code is comparing me.dept to a variable called ACCOUNTING
Therefore,
If (Me![Dept]) = ACCOUNTING Then
should read
If (Me![Dept]) = "ACCOUNTING" Then
Assuming your table/query is sorted by Date, you can use the dlast function to achieve this, something like;
=Dlast("[Hours]","TableName","[Date]<=dateserial(2010,02,05)")
Thanks for the reply.
I have a fairly complex report which has a sub-report and a handful of other text boxes in the detail section. All are the same height of the detail section.
The subreport has a background meaning the printed page has a continuous background from top to bottom (excluding...
Does anyone know if it is possible to use the Me.Line (X1, Y1)-(X2, Y2), Color, BF (or any other) function to draw a box in 'send to back' mode on a report?
I was hoping it would draw the box as a background for other text on the report but it is being drawn over it.
The rowsource of your second combo box references [Forms]![Form1]![Place] but there is no control called 'Place' on Form1
Is Form1 supposed to be an unbound form?
When you get to 99999, you'll have to find out the 'character code' of the letter, add 1 to it and then return the character of the incremented character code.
eg, Chr(Asc(Left(sRefID, 1)) + 1)
You will also have to test for the letter being Z
After the date field, there are 24 time calculations determining whether there was a call during the hour.
Something else may have to be done because the same extension may be used twice in one hour but I think the above calculation (when grouped on date) would show a count of 2 when (I'm...