Microsoft
Software
Hardware
Network
Question : VBA DCount problem
Hi EE
On a previous post i asked a question regarding DCount. which Capricorn1 answered for me.
Unfortunatly after using the solution on the second button on the form i came accross a small problem.
I have a button for breaks and also a button for Lunch on a form that a memeber of staff press. they are allowed to press the break button twice and the lunch button once each day.
The code Capricorn1 gave me to do this was:
If DCount("TimeLogedOut", "tblTimeSheet", "[DateToday] = #" & Date & "# And empID=" & [Forms]![frmGENSwitchboard
]![EmpID]>
0 Then
MsgBox "you have already taken your allocated break time"
Exit Sub
End If
This worked great when i first used it on the Break Button, however when i then used it on the Lunch button it came up with the message on first press because the VBA requires one more filter
i have tried to re-write the code to include this extra filter but i cant get it working
can any one help
If DCount("TimeLogedOut", "tblTimeSheet", "[DateToday] = #" & Date & "# And empID=" & [Forms]![frmGENSwitchboard
]![EmpID] And [CodeOUT] = "BREAK") > 0 Then
MsgBox "you have already taken your allocated break time"
Exit Sub
End If
as you can see from the code above the field i also need to filter for is CodeOUT and need to filter it to the fields that contain "BREAK"
The bit i added was at the end And [CodeOUT] = "BREAK"
What do i add to Capricorn1 Code at the very top in order to aditionaly filter for this?
Answer : VBA DCount problem
for i in `cat a.txt`
do
----
done
Random Solutions
asp.net-easy question
2 raid controllers managing the disk array
Vmware Virtual Centre Service not starting
Any good advanced javascript books/links to recommend?
redirecting domain.com to
www.domain.com
in IIS7?
The trust relationship between this workstation and the primary domain failed
RAID 10 array keeps failing on HP P410i
Guest Wireless Network
EASY VPN CISCO
Login to SSRS as andmistrator rather than anonymous user.