WalterInOz
Registered User.
- Local time
- Today, 12:29
- Joined
- Apr 11, 2006
- Messages
- 93
Hi all,
We have documents on the server that employees frequently need to fill in, such as time sheets, expenses, training records etc. People often have a copy of these docs on their own PCs for their convenience (no more looking for the docs on the server). A problem occurs when docs are updated and people submit outdated documents. I've tried to make access to the most recent docs easy by creating a little database with a link to the current doc behind buttons. This works OK. however, ... there are always people that forget to save a copy to their PC BEFORE enetering data into the forms despite a messagebox popping up telling them to do a -save as- first.
P
It would be better if when people click a button for a form the form gets copied to the desktop, then opens and they can start to enter data. I can't get it right though.
Could you please have a look at what I've got so far and comment on what might be the error?
Here's my code:
I get an error message on FollowHyperlink stAppName
That's not the only problem though as I don't see the file copied to my desktop either.
Thanks for your help.
We have documents on the server that employees frequently need to fill in, such as time sheets, expenses, training records etc. People often have a copy of these docs on their own PCs for their convenience (no more looking for the docs on the server). A problem occurs when docs are updated and people submit outdated documents. I've tried to make access to the most recent docs easy by creating a little database with a link to the current doc behind buttons. This works OK. however, ... there are always people that forget to save a copy to their PC BEFORE enetering data into the forms despite a messagebox popping up telling them to do a -save as- first.
P
It would be better if when people click a button for a form the form gets copied to the desktop, then opens and they can start to enter data. I can't get it right though.
Could you please have a look at what I've got so far and comment on what might be the error?
Here's my code:
Code:
Private Sub cmdTimesheet_Click()
Dim StrMsg As String
Dim stDocName As String
Dim stLinkCriteria As String
Dim strFileName As String
Dim strFileNameCopy As String
Dim fileObj As Object
Dim stAppName As String
'strFileName is Name of the Form you want to copy, add the .doc/.xls or whatever extension
strFileName = "Timesheet.xls"
strFileNameCopy = Format$(Nz(Environ("username")) & strFileName)
'path to Form to copy
strFileName = "V:\HR_Administration\4_Staff_Forms\" & strFileName
'path to folder in which the New Form should be saved
strFileNameCopy = "C:\Documents and Settings\" & Format$(Nz(Environ("username")) & "\Desktop" & strFileNameCopy)
Set fileObj = CreateObject("scripting.filesystemobject")
fileObj.copyfile strFileName, strFileNameCopy, True
'Dim stAppName As String
stAppName = "C:\Documents and Settings\" & Format$(Nz(Environ("username")) & "\Desktop" & strFileNameCopy)
FollowHyperlink stAppName
DoCmd.Maximize
End sub
I get an error message on FollowHyperlink stAppName
That's not the only problem though as I don't see the file copied to my desktop either.
Thanks for your help.