Save string with a Long date to a field with datevalue(string)

56 Views Asked by At

I have a string variable Ldatum with a Long date ("28 mei 2023"). I want to save it into a datefield in a table. The datefield called VDADatum is date with long date notation in the field properties.

I use the function Datavalue(Ldatum). I get the error

types doesn't match

I use the following code

If Not rd.NoMatch Then 'record found
    rd.Edit
    rd!VDADatum = DateValue(Ldatum)
    rd.Update
end if

I get the error

types doesn't match

I tried cdate.

Is it possible it has something to do with my region settings?

1

There are 1 best solutions below

0
tbennekik On

Instead of a long date ("28 mei 2023"), I copied a short ("28/5/2023) date into the field.

In the table the short date has automatically changed into a long date.