Split Form Open and SelectObject (1 Viewer)

Samantha

still learning...
Local time
Today, 06:42
Joined
Jul 12, 2012
Messages
180
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
 

CJ_London

Super Moderator
Staff member
Local time
Today, 11:42
Joined
Feb 19, 2013
Messages
16,605
try removing the "" from filter and where parameters of your openform line.

Edit - taken out bit about $ - was wrong
 
Last edited:

static

Registered User.
Local time
Today, 11:42
Joined
Nov 2, 2015
Messages
823
Code:
Private Sub CmdBids_Click()
On Error Resume Next
    DoCmd.Close acForm, "frmReports", acSaveNo
    DoCmd.Close acForm, "frmBids", acSaveNo
    DoCmd.OpenForm "frmBids"
End Sub
 

Samantha

still learning...
Local time
Today, 06:42
Joined
Jul 12, 2012
Messages
180
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

Top Bottom