if nz(datefield,0)>date then
msgbox("Date Cannot be after today")
cancel = vbcancel 'refuses to accept it
sendkeys "{esc}" 'undoes what he did, which is a nice interface idea
end if
if nz(datefield,0)>date then
msgbox("Date Cannot be after today")
cancel = vbcancel 'refuses to accept it
sendkeys "{esc}" 'undoes what he did, which is a nice interface idea
end if
What I meant was without seeing the database. What are the settings for that particular field in the table? When you say it "is coming from Data Base," do you mean a linked table from SQL Server or something? Or is it just in the current database?
i gave you a code snippet, but it didby have this text, and neither did anything else posted ot help you - so you must have got something from somewhere else that isnt working right. Can we see your code - you need the beforeupdate event for this date field
Remember, dates are defined as numerical codes in the system background, so you can use a numerical entry.
Select the field on the form design, then go to properties. In the data tab, Validation rule, enter <=date() for dates equal to or prior to today. Then you can add a Validation statement like "Entry must be today or before." - remember the quotes.