Microsoft
Software
Hardware
Network
Question : Problem with DCount in VBA using a variable for a table name enbedded in a form
Hello.. Having problem with DCount in VBA.
I have a form that has a hidden variable, txtMasterTable, that contains a table name. I want to count the number of records in that table using DCount. This works when I hard code the table name. However, when I use Me.txtMasterTable it is not working. I suspect this is just a quote placement issue?? Code below, thanks in advance:
MsgBox DCount("*", "& """ & Me.txtMasterTable & """ &", "[Invalid Contract] =0 And [MissingContract] = 0 and DateTimeSubmittedtoDB = #" & Me.txtDateTime & "#")
Answer : Problem with DCount in VBA using a variable for a table name enbedded in a form
Try this:
MsgBox DCount("*", Me.txtMasterTable, "[Invalid Contract] =0 And [MissingContract] = 0 and DateTimeSubmittedtoDB = #" & Me.txtDateTime & "#")
Random Solutions
Advice needed... getting data from another application into Access
Font in Cobo Box shrinks when I select from it
Escape while loop, then re-run while loop
Exchange 2007 cannot receive external email
Exactly what does Compact and Repair do?
Delete all asp.net users with applicationId = xx
Using Radio buttons across multiple columns in GridView
How do I format text to diplay currency in VB?
How do i get XP OEM key off HP laptop?
windows server 2003 server hack issue