M
M Skabialka
I downloaded a Microsoft template for Project management and found some code
I do not understand. The form load is called from another form with this
line:
DoCmd.OpenForm "Project Details", acNormal, "", "[ID]=" & ID, , acDialog
The code was converted from the On Load macro.
If (Not IsNull(OpenArgs)) Then
DoCmd.GoToRecord , "", acNewRec
End If
If (Not CurrentProject.IsTrusted) Then
Exit Sub
End If
TempVars.Add "NewData",
"Mid(Nz([OpenArgs]),InStr(Nz([OpenArgs]),""="")+1)"
On Error Resume Next
If (TempVars!NewData <> "") Then
[Project Name] = TempVars!NewData
End If
TempVars.Remove "NewData"
This code takes whatever the name of the Project is, and replaces it with
Mid(Nz([OpenArgs]),InStr(Nz([OpenArgs]),"=")+1)
This of course corrupts the actual project name.
Can anyone tell what may have been lost in the translation from Macro to VBA
code so I can make this work properly?
Mich
I do not understand. The form load is called from another form with this
line:
DoCmd.OpenForm "Project Details", acNormal, "", "[ID]=" & ID, , acDialog
The code was converted from the On Load macro.
If (Not IsNull(OpenArgs)) Then
DoCmd.GoToRecord , "", acNewRec
End If
If (Not CurrentProject.IsTrusted) Then
Exit Sub
End If
TempVars.Add "NewData",
"Mid(Nz([OpenArgs]),InStr(Nz([OpenArgs]),""="")+1)"
On Error Resume Next
If (TempVars!NewData <> "") Then
[Project Name] = TempVars!NewData
End If
TempVars.Remove "NewData"
This code takes whatever the name of the Project is, and replaces it with
Mid(Nz([OpenArgs]),InStr(Nz([OpenArgs]),"=")+1)
This of course corrupts the actual project name.
Can anyone tell what may have been lost in the translation from Macro to VBA
code so I can make this work properly?
Mich