date field being equal to the lastPaymentDate

D

Dan

can anyone tell me why this won't work:

Dim lastPaymentDate As Date
lastPaymentDate = DMax
("Date", "PaymentsReceived", "[memberNumber] = " & Me.
[Member Number])

previouspaymentnumber = DMax
("PaymentID", "PaymentsReceived", "[memberNumber] = " &
Me.[Member Number] & " AND [Date] = " & lastPaymentDate)

I have tried: format(lastPaymentDate, "mm/dd/yyyy") but
it still comes up null. I think that it must be a problem
with the format of the field [date] not being equal to
the lastPaymentDate
 
F

Frank Stone

hi,
Try nesting your date fields between #Date#.
Access may not be recognizing the fields as dates.
the ## symbles would tell access the data is dates.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top