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
Net Logon Errors
Attaching printer to S30 Thin Client
MS Access Specify Table Error
How to lock a Record (Row) in an Access database using DAO 3.6.0, PLEASE HELP!
SQL Select query with Case when creating a frequency distribution
Server is not configured for transactions
Changing calendar from 5 days a week to 7
The World Wide Web Publishing Service (WWW Service) did not register the URL prefix <a rel="nofollow" href="https://*:443/" target="_blank">https://*:443/</a> for site 1.
Problem with Check Box Form Control
MS SQL FTS Index Population Error