open and close form code

G

Guest

I have a startup screen (form) with a button that has the below code. The
button opens my switchboard. What code would I add that would also close my
startup screen?

Private Sub cmdOpenSwitch_Click()
On Error GoTo Err_cmdOpenSwitch_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Switchboard"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdOpenSwitch_Click:
Exit Sub

Err_cmdOpenSwitch_Click:
MsgBox Err.Description
Resume Exit_cmdOpenSwitch_Click

End Sub

Many thanx,

Rip
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top