Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dates (again) Access 2

Status
Not open for further replies.

santastefano

Programmer
Aug 9, 2005
54
IT
I am trying to run either of the following lines.
varBegin = Weekday(Date, Forms!frmCourseStart!StartDate)
varBegin = DatePart(d, Forms!frmCourseStart!StartDate)

varBegin is a declared variable
Forms!frmCourse!StartDate is a user input date on a form which is open when this runs (format dd/mm/yyyy.

Both return the error message invalid procedure call or argument.

I have searched here, the Access 2000 book and MSDN and can not find a solution.
Can anybody please help?
 
varBegin = Weekday(Forms!frmCourseStart!StartDate)
varBegin = DatePart("d", Forms!frmCourseStart!StartDate)


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 

is this a REAL DATE ???

or is it a STRING that looks like a date???

Forms!frmCourseStart!StartDate

You may ave to convert your string to a real date via the DateSerial Function
Code:
varBegin = Weekday(Date, DateSerial(YearFromString,MonthFromString,DayFromString)


Skip,

[glasses] [red]A palindrome gone wrong?[/red]
A man, a plan, a ROOT canal...
PULLEMALL![tongue]
 
Skip, in which version of VBA is your posted Weekday function running without trouble ?
 


PHV,

he he, er, uh...

I completely missed the TWO ARGUMENT issue.

Skip,

[glasses] [red]A palindrome gone wrong?[/red]
A man, a plan, a ROOT canal...
PULLEMALL![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top