Dmax & todays date

Jonno

Registered User.
Local time
Today, 03:46
Joined
Mar 17, 2003
Messages
74
Afternoon everyone

I have had a search on this and couldn't really find what I was after, forgive me if it sits blaringly obviously in a previous post.

I have a table called "Xmaster", with a name field "Staff" and a time field called "from".

There is a form "Star1" which has the textbox "text190" containing a name.

The following works

Dim findtime As Variant
findtime = DMax("[from]", "xmaster", "[staff] = forms!star1!text190")

There is also a field in the table called "date".

I would like to add 'where the date field = todays date'.

What is the correct syntax way when this into the dmax function ?
 
1) Dont use textboxes and leave the names "Text190".... rename them to something that reflects their purpuse .... for this one something like txtSearchName (or something)
In the long run you will get lost in the numbered boxes....

2) Dont use reserved words like Date as a field name.... There must be some better name you can come up with than date...

3) The fix:
findtime = DMax("[from]", "xmaster", "[staff] = forms!star1!text190 and [Date] = #" & Date & "#")
If that will work with the "Date" field... *Keeping fingers crossed* Re: 2

Regards
 
namliam, you are very helpful - thanks. :D
 

Users who are viewing this thread

Back
Top Bottom