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
MiniDump not saving to C:\windows\minidump
Using Forms Stored in an Access Library Database
Crosstab Query with Decimal column Headers for MS Graph Datasheet
SBS 2008 Premium install , SQL part on VM
Gating Role
Data Loss & Recovery - FAT 16 - NTFS 160GB USB drive. Possible bad MBR or Partition Table
how to schedule a daily task run stored procedure with sqlserver 2005
sql question
Run a PowerPoint Tutorial Before User Log In
XL Placing a value in an empty Cell with a Visual Basic Rprogram.