Dcount

mester

Member
Local time
Today, 14:33
Joined
Apr 2, 2020
Messages
63
Hi everyone, if you please i wanna count how many lignes between two dates, i mean date from A to B. So i used dcount, but i didn't know what to use in the criteria.
Me.textbox1=Dcount("[expr1]","table1","[criteria1]= between #"& me!textbox5 &"# and #"& me!textbox6 &"# ")
Is this one correct please????
 
Me.textbox1=Dcount("*","table1","between #" & format(me.textbox5,"mm/dd/yyyy") & "# and #" & format(me.textbox6,"mm/dd/yyyy") & "# ")

Does that work?
 
Me.textbox1=Dcount("*","table1","between #" & format(me.textbox5,"mm/dd/yyyy") & "# and #" & format(me.textbox6,"mm/dd/yyyy") & "# ")

Does that work?
Hi , i am working on it to see if it will work
 
Me.textbox1=Dcount("*","table1","between #" & format(me.textbox5,"mm/dd/yyyy") & "# and #" & format(me.textbox6,"mm/dd/yyyy") & "# ")

Does that work?
Sorry Sir, it doesn't work for me.
 
Can you post (Copy and Paste into your response here) the expression you're using in the Textbox?
Or the code, if it's VBA ?
 
Sorry, typo:
Try:
Code:
Me.textbox1=Dcount("*","table1","[DateFieldName] between #" & format(me.textbox5,"mm/dd/yyyy") & "# and #" & format(me.textbox6,"mm/dd/yyyy") & "# ")
 
Here is the code i used, thanks for your help
 

Attachments

  • IMG_20200909_232654.jpg
    IMG_20200909_232654.jpg
    459 KB · Views: 154
I corrected typo, see prev. post, thx
 

Users who are viewing this thread

Back
Top Bottom