command for close form and open the switchboard ?

anthonyevans

Registered User.
Local time
Today, 18:07
Joined
Mar 15, 2001
Messages
29
Dear All,

What is the line of VB code for opening the switchboard so it appears on the screen instead of having to scroll to the top to see it again, to be included in the following ?

Private Sub Command194_Click()
On Error GoTo Err_Command194_Click

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

stDocName = "Treatment Report"
DoCmd.OpenReport stDocName, acNormal, , "[Serial_Number] = [forms]![TREATMENT FORM]![Serial_Number]"

DoCmd.Close acForm, "TREATMENT FORM"

Exit_Command194_Click:
Exit Sub

Err_Command194_Click:
MsgBox Err.Description
Resume Exit_Command194_Click

End Sub

Thankyou in advance for your help.

Anthony
 
Why don't you just use Command buttons running from Macro's ?
Ie; if you have a command button to say 'Switchboard' and then create a macro to close the current form and reopen the switchboard ?
I have used this method a number of times, and it seems to work perfectly.

Email me if you need any further help.

-HTH
-NEIL L POPE
 
Add a command On Open event
Docmd.maximize me.name
 

Users who are viewing this thread

Back
Top Bottom