Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Not Working: DoCmd.OpenForm "FRM_Main"

Status
Not open for further replies.

AT76

Technical User
Apr 14, 2005
460
US
I'm trying to open a Form from code to execute some code I have on the "ON CURRENT" Event. I'm trying to accomplish this via:

DoCmd.OpenForm "FRM_Main", acNormal, "", "", , acNormal

But the Form does not open and the line of code goes to the line right after this one instead of jumping to:

Private Sub Form_Current()

Am I doing something wrong? Is there another way of accomplishing this?

Thank you!

Andres
 
What kind of code are you trying to execute on current event what triggers your docmd.openform ?
 
Let me attach my code. Here's the first code which code from a button on a different form:

Private Sub Command124_Click()

On Error GoTo Mcr_OpenCycleDesk_Err

DoCmd.OpenForm "FRM_Main", acNormal, "", "", , acNormal



If (Eval("[Forms]![FRM_SELECTCRITERIA]![VEND] Is Null And [Forms]![FRM_SELECTCRITERIA]![PLNR] Is Null")) Then
Forms!FRM_Main.Caption = "CYCLE DESK VIEW"
Forms!FRM_Main.propSetTitle = Forms!FRM_Main.Caption
Forms!FRM_Main.RecordSource = "QRY_CycleDesk"
Forms!FRM_Main.propSetRecordSource = Forms!FRM_Main.RecordSource
End If

If (Eval("[Forms]![FRM_SELECTCRITERIA]![VEND] Is Null And [Forms]![FRM_SELECTCRITERIA]![PLNR] Is Not Null")) Then
Forms!FRM_Main.Caption = "CYCLE DESK PLANNER SPECIFIC"
Forms!FRM_Main.propSetTitle = Forms!FRM_Main.Caption
Forms!FRM_Main.RecordSource = "QRY_CycleDeskPLNR"
Forms!FRM_Main.propSetRecordSource = Forms!FRM_Main.RecordSource
End If

If (Eval("[Forms]![FRM_SELECTCRITERIA]![VEND] Is Not Null And [Forms]![FRM_SELECTCRITERIA]![PLNR] Is Null")) Then
Forms!FRM_Main.Caption = "CYCLE DESK VENDOR SPECIFIC"
Forms!FRM_Main.propSetTitle = Forms!FRM_Main.Caption
Forms!FRM_Main.RecordSource = "QRY_CycleDeskVEND"
Forms!FRM_Main.propSetRecordSource = Forms!FRM_Main.RecordSource
End If

If (Eval("[Forms]![FRM_SELECTCRITERIA]![VEND] Is Not Null And [Forms]![FRM_SELECTCRITERIA]![PLNR] Is Not Null")) Then
Forms!FRM_Main.Caption = "CYCLE DESK PLANNER and VENDOR SPECIFIC"
Forms!FRM_Main.propSetTitle = Forms!FRM_Main.Caption
Forms!FRM_Main.RecordSource = "QRY_CycleDeskPLNRVEND"
Forms!FRM_Main.propSetRecordSource = Forms!FRM_Main.RecordSource
End If

Mcr_OpenCycleDesk_Exit:
Exit Sub

Mcr_OpenCycleDesk_Err:
MsgBox Error$
Resume Mcr_OpenCycleDesk_Exit

End Sub

On form: FRM_Main, I want to app to jump to form: "FRM_Main" and execute the "ON CURRENT" code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top