Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with a between function.

Status
Not open for further replies.

Viruland

Programmer
Dec 6, 2000
61
BE
How do you use a between function as a criteria to open a form?
I have tried this on many ways but is doesn't work.

Dim stCriteria as String
Dim stDateFirst as Date
Dim stDateLast as Date
Dim stFormName as String

stFormName = "Frm_IKA"
stDateFirst = dateDatum1
stDateLast = dateDatum2

stCriteria = Between & " [Date] = #" & stDateFirst & "# And [Date] = #" & stDateLast & "#"

docmd.openForm stFormName,,stCriteria
Live fast, die young and leave a beautiful corpse behind.
 
Have you tried:

Dim stCriteria as String
Dim stDateFirst as Date
Dim stDateLast as Date
Dim stFormName as String

stFormName = "Frm_IKA"
stDateFirst = dateDatum1
stDateLast = dateDatum2

stCriteria = "DATE-FIELD-NAME-HERE Between #" & stDateFirst & "# And #" & stDateLast & "#"

docmd.openForm stFormName,,stCriteria

Missy Ed
Looking to exchange ideas and tips on VB and MS Access development as well as office 97 development. Drop me a line: msedbbw@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top