I have created a module as below, which when I use Run in the VBA window does exactly what i want it to.
However when i then run this from a macro i constantly get a message box saying that
"the expression you entered has a function name that the [database] cannot find"
In the macro i have used Run Code with ChangeDataType() as the function name.
The module is called modChangeDataType
Public Sub ChangeDataType()
Dim dbase As DAO.Database
Set dbase = CurrentDb
dbase.Execute ("ALTER TABLE tblReopenDates ALTER COLUMN [ReopenDate] date;")
End Sub
I'm stumped as I have tried every permutation of naming for the function i can think of, but still it sends an error every time.
Any ideas?
Thanks