list records between two dates from unbound textbox in a subform (1 Viewer)

BEJAN

New member
Local time
Today, 17:18
Joined
Oct 15, 2018
Messages
2
hello
I need to create a code that can list records between date range from unbound textboxes to show them in a subform.
I dont wanna use query form.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 14:18
Joined
Feb 19, 2013
Messages
16,553
not sure what you mean by query form but suggest you need a button on the main form with the code along these lines (put your own names in)

Code:
me.subformname.form.filter="somedate between #" & format(me.txtFromDate, "mm/dd/yyyy") & "# AND #" & format(me.txtToDate, "mm/dd/yyyy") & "#"
me.subformname.form.filteron=true
 

BEJAN

New member
Local time
Today, 17:18
Joined
Oct 15, 2018
Messages
2
thank you for your replay I need to put dates range and then i can display them in the subform but without using the query. Just the code
 

CJ_London

Super Moderator
Staff member
Local time
Today, 14:18
Joined
Feb 19, 2013
Messages
16,553
you had better explain exactly what you mean - provide some example data and what you want as a result
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 22:18
Joined
May 7, 2009
Messages
19,169
then change the recordsource of the subform:

me.subformname.form.recordsource="Select * from yourTable Where [dateField] between #" & format(me.txtFromDate, "mm/dd/yyyy") & "# AND #" & format(me.txtToDate, "mm/dd/yyyy") & "#"
 

Users who are viewing this thread

Top Bottom