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
SQL Join Group and SUM
Write Confilcts on Unbound Form using DAO Recordset
Treeview to XML code - not getting sub nodes correctly
How do I change the content of the variable is the variable value is a string plus Numbers?
How can I remove NTFS writing permission to everyone
Convert .htaccess to web.config
Change fore color and back color of item in check list Box
How to save Excel 2007 spreadsheets into a form readable by Lotus 123
IIS 7
The password does not meet the password policy requirements.