I'm trying to set the ControlSource of a TextBox in VBA.
Normally this is simple:
Me.TextBox.ControlSource = "=Date()"
But...
I need to use the DateAdd function:
Me.TextBox.ControlSource = "=DateAdd('w';1;Date())"
This gives an error: 'the syntax of the expression you gave is invalid'
the problem is the '=' sign. Without that I have no error, but of course, the ControlSource is not right then... (it gives #name?")
Normally this is simple:
Me.TextBox.ControlSource = "=Date()"
But...
I need to use the DateAdd function:
Me.TextBox.ControlSource = "=DateAdd('w';1;Date())"
This gives an error: 'the syntax of the expression you gave is invalid'
the problem is the '=' sign. Without that I have no error, but of course, the ControlSource is not right then... (it gives #name?")