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
No permissions for Database, but have .mdw file. How can I edit it t gain acces to Db?
Import .csv file into Access
Retrieving info from DropDownList on OnSelectedIndexChanged in a repeater
Pass through query with declare doesn't return records
foxpro sql insert data with comma in text
Access 2000 Runtime
form set focus vb.net
Use range of Cells as criteria for Excel Query
How to change the location of Listbox using code
The semaphore timeout period has expired. Unable to create folder.