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
How can I install a Third Party certificate within IE7 on Terminal Server for all users
Missing ; at end of SQL statement
How to read a DMP file?
sortable table in Mac Excel
Combine data from two separate tables.fields into one Query field
Insufficient system resources exist t complete the requested service
Closing a VB form after button click completes
Windows 98 Splash Screen (logo) freezes during bootup
STOP: 0x00000007B (0xF7B44528, 0xC0000034, 0x00000000, 0x00000000)
Working with recordsets