Open form and display a Date in a field

Jon123

Registered User.
Local time
Today, 14:17
Joined
Aug 29, 2003
Messages
668
On a form I want to display the Date of the last time a customer
has been in. The Form is bound to a table that has the records
for every customer and the dates that they have been in to pick up.
I want to have an unbound field that displays the last date.

I have the customer ID i just dont know how to code it in the on open
event.

Please help

jon
 
Have a look at the Dmax() function. In your Form's On Load event you will need some code that looks something like;
Code:
Me.YourTextBoxName = Dmax( "CustomerVisitDate", "YourTableName", "CustomerID =" & Me.CustomerID)
 
its close still having trouble.
if I put this code in the OnLoad I will get the highest date enter into the table.
Me.[tempdate] = DMax("[Dateofvisit]", "[table1]")

when I add the customer ID I get a Syntex error (missing operator) in query expression '[customer ID] ='

Me.[temp] = DMax("[Dateofvisit]", "[table1]", "[customer ID] =" & Me.[ccID])


thanks for the help

jon
 

Users who are viewing this thread

Back
Top Bottom