I have the following code that does not seem to work.
I am generating a Word dokument without any problems, but any empty textbox generates a Null error.
To prevent this i thought of using this code, but it is not solving the issue.
It just seems to jump over thevbNullString part.
Any tips?
I am generating a Word dokument without any problems, but any empty textbox generates a Null error.
To prevent this i thought of using this code, but it is not solving the issue.
It just seems to jump over thevbNullString part.
Any tips?
Code:
If Me.MaxBar <> vbNullString Then
MsgBox "Field shall contain a value"
Exit Sub
Else
FindText = "[PdX]"
ReplaceWith = Me.MaxBar
.Execute FindText:=FindText, ReplaceWith:=ReplaceWith, Replace:=2
End If