Passing date

Giganews Newsgroups
Subject: Passing date
Posted by:  rwpearson1…@gmail.com
Date: Wed, 18 Apr 2018

I have been trying to pass a date/s to  sql but to no avail.

The start and end dates are in the tblConfiguration and I've tried using DLookup as shown below......no workie!!

What am I doing wrong????

Dim StartDate As String
Dim EndDate As String

StartDate = DLookup("[YearBegins]", "[tblConfiguration]")
EndDate = DLookup("[YearEnds]", "[tblConfiguration]")

Me.RecordSource = "SELECT * FROM tblIncome where [tblIncome].[TransactionDate] Between StartDate and EndDate"

TIA

Replies