Hi
I'm trying to create a form that a user can type in a year, such as 1998, and then click a button that will find out which day of the week that year started on, and then calculate what date every monday in that year will fall on. Basically to find the beginnings of each week in a given year.
Where I have a question is when I display (in a text box on the form) the full date for January 1, XXXX.
I know I can say something like:
But I want to be able to append the year that the user entered to the year portion of the function above.
I have seen where I can make SQL statements in VBA by doing something like:
where code is some string that the user entered.
When I try this syntax with the date, I get an Expression Expected error.
Is there any way to do this, or is it not possible to use a variable in the date?
thanks
I'm trying to create a form that a user can type in a year, such as 1998, and then click a button that will find out which day of the week that year started on, and then calculate what date every monday in that year will fall on. Basically to find the beginnings of each week in a given year.
Where I have a question is when I display (in a text box on the form) the full date for January 1, XXXX.
I know I can say something like:
Code:
Me.FirstDay = #01/01/1998#
I have seen where I can make SQL statements in VBA by doing something like:
Code:
mySQLString = " & code & "
When I try this syntax with the date, I get an Expression Expected error.
Is there any way to do this, or is it not possible to use a variable in the date?
thanks
Comment