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
Your log in to the Switchboard timed out. Please click OK to reload or Cancel to quit.
object required error
2 IP to same windows 2003 server for RDP and VPN issue
What is the best cms to use with dreamweaver
PHP Loading Bar
Cannot open help files in WIN7
Clearing a submit form once submitted
Include C++ header files in .Net Application
I am having trouble opening a .bat file in a VBA Excel Macro
Generated Migration Scripts for Models via Console