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
Error when running adprep32/forest prep
SSL Certificates for Exchange 2010
Can Windows Server Standard 2008 FE be upgraded to Standard level without breaking Exchange 2007 SP1 currently installed?
Hyper v full Installation remote administration issues
What are the different types of .NET assemblies?
Classic ASP form to email sending empty email?
Create linked server from MS Sql to oracle server
VB.Net Ineritance question
Number of records when appending query via VBA
Which is the most reliable laptop and processor and OS?