Hi
I'm not sure if this is the right forum.
The code below is in a command button which opens a word doc to a specific employees registration Number.
This works fine (if the document already exists) BUT how would i be able (check that a doc exists 1st) to open a NEW Word document if 1 does not exist? (I would assume an if statement would be required?)
It would then be better to go 1 step further and create a new document if required with the name = EmpregNbr.
Hope you are able to help
Thx
Darin
I'm not sure if this is the right forum.
The code below is in a command button which opens a word doc to a specific employees registration Number.
This works fine (if the document already exists) BUT how would i be able (check that a doc exists 1st) to open a NEW Word document if 1 does not exist? (I would assume an if statement would be required?)
It would then be better to go 1 step further and create a new document if required with the name = EmpregNbr.
Hope you are able to help
Thx
Darin
Code:
Private Sub cmdOpenWord_Click()
Dim stAppName As String
Dim stPathA As String
Dim stPathB As String
Dim stPathC As String
Dim stCombinedPath As String
Dim EmpRegNbr As Integer
EmpRegNbr = Me.EmpRegNo
stPathA = SysCmd(acSysCmdAccessDir)
stAppName = "WINWORD.EXE "
stPathB = "\\Darin\LynxDatabase\EmpWord\" '"c:\1\"
stPathC = ".doc"
stCombinedPath = stPathA & stAppName & stPathB & EmpRegNbr & stPathC
Call Shell(stCombinedPath, 1)
End Sub