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
tempdb in RAM on SQL Server 2005
Extract Birthdays between now and 30 days from today
MS Access turn values into percentages
sql server add valid owner
How to enter the Product Key in MS Exchange 2010
A Beautiful Disaster, multiple issues on Windows 7 / Vista Ultimate 64bit
Windows 2008 Server immediately logging off Terminal Services sessions created from .msi / Windows Install Package
Macro notification question
extract numbers from a cell
RDP in Adminpak.msi for Windows Server 2003/XP: How to turn off the connect local resource option