Help with a DCount

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
2,347
Office Version
  1. 365
Platform
  1. Windows
I want to look in one table (tblRFPManager) and count how many times a value from a Textbox on a form appears.

I want to search a table named tblRFPManager in a field named PID_Number. I want to know how many times the value on my form frmPIDGenerator in TextBox Text97 appears in the table.

Is it

DCount([PID_ID],[tblRFPManager],[PID_Number]=Text97)

Im away from my db so I cannot try it. Do I use the brackets?

Or would it be
DCount(PID_ID,tblRFPManager,PID_Number=Text97)

Or neither?
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Neither - the expression and the domain are string arguments therefore need to be treated as strings:

Code:
Dcount("*","TblRFPManager","[PID_Number] = " & Text97)
 
Upvote 0

Forum statistics

Threads
1,221,692
Messages
6,161,327
Members
451,697
Latest member
pedroDH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top