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
Droid Incredible Exchange Synchronization
SAP books for implementing ERP package
Outlook not attack shortcut (lnk) attach directly the file
Excel Interop: Find cell by formula
Removing writeprotect from storagedevices
Copy and Paste from cygwin xwin server guest machine to my pc notepad
Problem with MYSQL_QUERY AN UNION ALL
Exchange 2010. Install Failed, now can't uninstall
Change Username on SBS2008
Unable to assign a resource to meeting in Outlook 2010