J
John Martens
I have two 'pop-up' forms that come up from a main form. I
have some code in the main form buttons that when they are
selected that the text from the main form will carry over
to the popup forms so the user will know where they are at
in the program. The code looks to be the same, but on form
will not work while the other one does... Here is a
snippet of the code for reference:
THIS ONE WORKS:
Private Sub cmdShowElecData_Click()
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
On Error GoTo Err_cmdShowElecData_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim stToolID As String
Dim stCompName As String
stToolID = Form_frmFacilityDataInput.ToolID
stCompName = Me.CompName
stDocName = "frmElecData"
stLinkCriteria = "[CompID]=" & Me![CompID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Form_frmElecData.CompID.DefaultValue = Me![CompID]
Form_frmElecData.txtElecDataLabel.Caption = stToolID
& " " & stCompName & " ELECTRICAL DATA"
Exit_cmdShowElecData_Click:
Exit Sub
Err_cmdShowElecData_Click:
MsgBox Err.Description
Resume Exit_cmdShowElecData_Click
End Sub
***********************************************************
****************
THIS ONE DOES NOT:
Private Sub cmdOpenFacData_Click()
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
On Error GoTo Err_cmdOpenFacData_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim stToolID As String
Dim stCompName As String
stToolID = Form_frmFacilityDataInput.ToolID
stCompName = Me.CompName
stDocName = "frmFacData"
stLinkCriteria = "[CompID]=" & Me![CompID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Form_frmFacData.CompID.DefaultValue = Me![CompID]
Form_frmFacData.lblFacDataLabel.Caption = stToolID
& " " & stCompName & " FACILITY DATA"
'stToolID & " " & stCompName & " FACILITY DATA"
Exit_cmdOpenFacData_Click:
Exit Sub
Err_cmdOpenFacData_Click:
MsgBox Err.Description
Resume Exit_cmdOpenFacData_Click
End Sub
Any help/ideas would be greatly appreciated.
THanks!
John Martens
have some code in the main form buttons that when they are
selected that the text from the main form will carry over
to the popup forms so the user will know where they are at
in the program. The code looks to be the same, but on form
will not work while the other one does... Here is a
snippet of the code for reference:
THIS ONE WORKS:
Private Sub cmdShowElecData_Click()
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
On Error GoTo Err_cmdShowElecData_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim stToolID As String
Dim stCompName As String
stToolID = Form_frmFacilityDataInput.ToolID
stCompName = Me.CompName
stDocName = "frmElecData"
stLinkCriteria = "[CompID]=" & Me![CompID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Form_frmElecData.CompID.DefaultValue = Me![CompID]
Form_frmElecData.txtElecDataLabel.Caption = stToolID
& " " & stCompName & " ELECTRICAL DATA"
Exit_cmdShowElecData_Click:
Exit Sub
Err_cmdShowElecData_Click:
MsgBox Err.Description
Resume Exit_cmdShowElecData_Click
End Sub
***********************************************************
****************
THIS ONE DOES NOT:
Private Sub cmdOpenFacData_Click()
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
On Error GoTo Err_cmdOpenFacData_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim stToolID As String
Dim stCompName As String
stToolID = Form_frmFacilityDataInput.ToolID
stCompName = Me.CompName
stDocName = "frmFacData"
stLinkCriteria = "[CompID]=" & Me![CompID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Form_frmFacData.CompID.DefaultValue = Me![CompID]
Form_frmFacData.lblFacDataLabel.Caption = stToolID
& " " & stCompName & " FACILITY DATA"
'stToolID & " " & stCompName & " FACILITY DATA"
Exit_cmdOpenFacData_Click:
Exit Sub
Err_cmdOpenFacData_Click:
MsgBox Err.Description
Resume Exit_cmdOpenFacData_Click
End Sub
Any help/ideas would be greatly appreciated.
THanks!
John Martens