Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / March 2007

Tip: Looking for answers? Try searching our database.

DCount problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
zSplash - 30 Mar 2007 19:01 GMT
I am using the following for a form's textbox controlSource:

=DCount("[DRef]","[q1Main]",("[q1Main.DRef]">=#06/01/02# And
"[q1Main.DRef]"<=#06/30/06#) And "[q1Main.CaseType]"="CUS")

The count is 0, but I know the count should be larger than 0.  Does anyone
see something goofy in my code?

TIA
Douglas J. Steele - 30 Mar 2007 19:24 GMT
Your quotes are wrong.

=DCount("[DRef]","[q1Main]",("[q1Main.DRef]>=#06/01/02# And
[q1Main.DRef]<=#06/30/06#) And [q1Main.CaseType]='CUS'")

(that's And [q1Main.CaseType]= ' CUS ' " at the end)

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

>I am using the following for a form's textbox controlSource:
>
[quoted text clipped - 5 lines]
>
> TIA
zSplash - 30 Mar 2007 19:58 GMT
Thanks, Doug.  Now, instead of getting 0 as the count, I'm getting #Error.
What does that type of error indicate?  (Once again, I know there's
something to count.)

> Your quotes are wrong.
>
[quoted text clipped - 12 lines]
>>
>> TIA
Douglas J. Steele - 30 Mar 2007 21:35 GMT
Just noticed that the parentheses are off as well.

=DCount("[DRef]","[q1Main]","[q1Main.DRef]>=#06/01/02# And
[q1Main.DRef]<=#06/30/06# And [q1Main.CaseType]='CUS'")

Sorry about that.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)

> Thanks, Doug.  Now, instead of getting 0 as the count, I'm getting #Error.
> What does that type of error indicate?  (Once again, I know there's
[quoted text clipped - 16 lines]
>>>
>>> TIA
zSplash - 30 Mar 2007 22:56 GMT
Thanks for that.  (I had just added a paren at the end of the statement.)
Still getting the "#Error".  Will keep trying...  Thanks again for the help.

> Just noticed that the parentheses are off as well.
>
[quoted text clipped - 23 lines]
>>>>
>>>> TIA
zSplash - 30 Mar 2007 23:30 GMT
I misspelled something.  Oops.  Your code works great.  Thanks!

Now, if instead of the coded dates
([q1Main.DRef]>=#06/01/02# And [q1Main.DRef]<=#06/30/06#)
I want to add the dates from a parameterForm, it would seem like this would
work:

=DCount("[DRef]","[q1Main]","[q1Main.DRef]>=[Forms]![fgetStats]![tbxBegDate]
And (q1Main.DRef)<=[Forms]![fgetStats]![tbxEndDate]) And
[q1Main.CaseType]='CUS'")

It doesn't.  Do I have another paren messed up, or something worse?

TIA, AA

> Thanks for that.  (I had just added a paren at the end of the statement.)
> Still getting the "#Error".  Will keep trying...  Thanks again for the
[quoted text clipped - 27 lines]
>>>>>
>>>>> TIA
zSplash - 30 Mar 2007 23:42 GMT
Never mind, Doug.  I see the errors myself.  (About time, eh?)  Thanks for
everything.

>I misspelled something.  Oops.  Your code works great.  Thanks!
>
[quoted text clipped - 42 lines]
>>>>>>
>>>>>> TIA
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.