-
VBA Date problem
Hi,
I am new to this forum, and a novice VBA user. And would welcome help with this little problem.
I have two different forms that have a similar date requirement - I would like the current date entered into a field. This should be very simple, in oone form it works fine, in the other form it returns "Runtime Error 438" "object doesn't support this property or method".
The code is absolutely identical in both forms -
Dim dteToday As String
dteToday = Format(Date, "dd/mm/yyyy")
Me.tempDate = dteToday
Anyone have any idea's what I am doing wrong?
Thanks
-
Where the error occurs, is the field 9n the table\query expecting text or a date?
If it's a date field, it won't accept a string.
-
Hi Doug,
Thanks for your response.
In both cases the date field is of "short date" format. I have had no problems feeding text strings to date fields.
However if I rem out the Me.tempDate = dteToday it still returns the error, also if changing the field to a text field.
Very strange!
Gary
-
I would try setting the filed that you are trying to pass the date into to General date and then try running the code that you have posted.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules