irunergoiam
Registered User.
- Local time
- Today, 04:24
- Joined
- May 30, 2009
- Messages
- 76
I'm getting a compile error: Duplicate declaration in scope. I'm pretty sure it has something to do with me having the DimstDocName As String (in red) in there twice for two different procedures (one to run a delete query and the second to open the form again after closing).
There's something I'm missing, but I'm still just cutting my teeth with this. Any help would be most appreciated! Thanks...
Dim stDocName As String
stDocName = "1SARFPLDeptPositionSystemPermissions-DeleteNullValues"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Me.cmbSys1 = ""
Me.cmbPermission1 = ""
Me.cmbSys2 = ""
Me.cmbPermission2 = ""
Me.cmbSys3 = ""
Me.cmbPermission3 = ""
Me.cmbSys4 = ""
Me.cmbPermission4 = ""
Me.cmbSys5 = ""
Me.cmbPermission5 = ""
Me.cmbSys6 = ""
Me.cmbPermission6 = ""
Me.cmbSys7 = ""
Me.cmbPermission7 = ""
Me.cmbSys8 = ""
Me.cmbPermission8 = ""
Me.cmbSys9 = ""
Me.cmbPermission9 = ""
Me.cmbSys10 = ""
Me.cmbPermission10 = ""
Me.Refresh
DoCmd.Close
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmSystems"
DoCmd.OpenForm stDocName, , , stLinkCriteria
MsgBox (" Selected systems successfully added to position template. Add additional system(s)")
DoCmd.SetWarnings True
End If
End Sub
There's something I'm missing, but I'm still just cutting my teeth with this. Any help would be most appreciated! Thanks...
Dim stDocName As String
stDocName = "1SARFPLDeptPositionSystemPermissions-DeleteNullValues"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Me.cmbSys1 = ""
Me.cmbPermission1 = ""
Me.cmbSys2 = ""
Me.cmbPermission2 = ""
Me.cmbSys3 = ""
Me.cmbPermission3 = ""
Me.cmbSys4 = ""
Me.cmbPermission4 = ""
Me.cmbSys5 = ""
Me.cmbPermission5 = ""
Me.cmbSys6 = ""
Me.cmbPermission6 = ""
Me.cmbSys7 = ""
Me.cmbPermission7 = ""
Me.cmbSys8 = ""
Me.cmbPermission8 = ""
Me.cmbSys9 = ""
Me.cmbPermission9 = ""
Me.cmbSys10 = ""
Me.cmbPermission10 = ""
Me.Refresh
DoCmd.Close
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmSystems"
DoCmd.OpenForm stDocName, , , stLinkCriteria
MsgBox (" Selected systems successfully added to position template. Add additional system(s)")
DoCmd.SetWarnings True
End If
End Sub