Split Form Open and SelectObject

Samantha

still learning...
Local time
Today, 05:37
Joined
Jul 12, 2012
Messages
182
This should be very simple and was working up until about a week ago. I have been searching all day for a resolution. I have unbound modal form that acts as my menu. It contains several buttons in which the user selects and another form opens. Simple right? For some reason all of the forms work as expected except split forms. Here is the code on the onclick event of the button.
Code:
Private Sub CmdBids_Click()
'On Error GoTo CmdBids_Click_Err

    DoCmd.OpenForm "frmBids", acNormal, "", "", , acWindowNormal
    DoCmd.Close acForm, "frmReports", acSaveNo
    DoCmd.SelectObject acForm, "frmBids", False
          
CmdBids_Click_Exit:
    Exit Sub

CmdBids_Click_Err:
    MsgBox Error$
    Resume CmdBids_Click_Exit

End Sub

I have tried setting focus on one of the fields, moving to the last record and for the life of me I can't figure it out. Not producing any errors just not selecting the form. Any help is greatly appreciated!

Samantha
 
try removing the "" from filter and where parameters of your openform line.

Edit - taken out bit about $ - was wrong
 
Last edited:
Code:
Private Sub CmdBids_Click()
On Error Resume Next
    DoCmd.Close acForm, "frmReports", acSaveNo
    DoCmd.Close acForm, "frmBids", acSaveNo
    DoCmd.OpenForm "frmBids"
End Sub
 
CJ, for some reason the first time I ran it without the "" as suggested it worked. After that it went back to the same behavior.

Static, your suggestion worked perfectly. I suppose its similar to order of operations? My dear aunt sally...

Thank you both for your guidance!
 

Users who are viewing this thread

Back
Top Bottom