That is and where is the 5th & 6th argument?
That is and where is the 5th & 6th argument?
OOps I clicked soved on the wrong post.
How do I un solve this post?
Each of your form buttons will need to be modified with basically the same code. The acDialog does several things: 1) Turns on PopUp and Modal for the next form and 2) Suspends the code in the first form. Modal forces the user to complete or close the next form and PopUp makes the form the *top* form.
So this is what it looks like now.
What does the me.visible= False and True do?
When I have them in the script of the only button on my main form.
The form stays on top and does not allow access to or shows the next form called "Event Selector"
-----------------------------------------------------------
Private Sub Command48_Click()
On Error GoTo Err_Command48_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Event selector"
Me.Visible = False
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.OpenForm stDocName, , , , , acDialog
Me.Visible = True
Exit_Command48_Click:
Exit Sub
Err_Command48_Click:
MsgBox Err.Description
Resume Exit_Command48_Click
End Sub
Too many OpenForms! Get rid of the RED one.
Code:Private Sub Command48_Click() On Error GoTo Err_Command48_Click Dim stDocName As String Dim stLinkCriteria As String stDocName = "Event selector" Me.Visible = False DoCmd.OpenForm stDocName, , , stLinkCriteria DoCmd.OpenForm stDocName, , , , , acDialog Me.Visible = True Exit_Command48_Click: Exit Sub Err_Command48_Click: MsgBox Err.Description Resume Exit_Command48_Click End Sub
Will the me.Visible = False/True
Work when I want to open a report? as in code below..
When I run this it puts the report in the back and locks Access up.
---------------------------------------------------
End Sub
Private Sub Xmas_dinner_sample_01_Click()
On Error GoTo Err_Xmas_dinner_sample_01_Click
Dim stDocName As String
stDocName = "Xmas_01"
Me.Visible = False
DoCmd.OpenReport stDocName, acPreview
Me.Visible = True
Exit_Xmas_dinner_sample_01_Click:
Exit Sub
Err_Xmas_dinner_sample_01_Click:
MsgBox Err.Description
Resume Exit_Xmas_dinner_sample_01_Click
End Sub
You need to specify the Dialog WindowMode.
DoCmd.OpenReport stDocName, acPreview, , , acDialog
Great I will try that tomorrow pm.
Thanks again.
Thanks
That seems to work but now my return buttons are not working. I button on each form that will return me back to a previous form/menu?
--------------------------------------------------
Private Sub Main_Window_Click()
On Error GoTo Err_Main_Window_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Main Menu"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Main_Window_Click:
Exit Sub
Err_Main_Window_Click:
MsgBox Err.Description
Resume Exit_Main_Window_Click
End Sub
The previous form is still open but invisible. You so not need to open it. Just close the current form and it will return to the previous form. Pressing the X in the upper right will do it. Or DoCmd.Close acForm, Me.Name, acSaveNo
Once I removed me.visible it works for now.
I have removed most of the user options such as the maximise, minimise, close scrollbars etc. form all three forms/menus.
My main menu has nothing but the form/menu, no top, bottom, borders, switches,etc just the way I want it.
The next two forms have a blue top border with the name of the form. How do I get rid of the top border of my form?
I have checked the properities of my main menu to the properities of the other two menu's and can't see where the difference is.
Am I looking in the correct place?
Try setting the BorderStyle to NONE on the Format tab.
All three of my forms have the Border style set to NONE.
Would it have something to do with the code for the button that open the forms. Like the ones below.
I noticed that all the buttons will work once when I first open the file. Then when I return to the main form and make changes to the data on the form then select the next two forms the top border is back on top.
It does work once. So something is turning on the border in two of my three forms.
-----------------------------------
End Sub
Private Sub Command48_Click()
On Error GoTo Err_Command48_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Event selector"
Me.Visible = False
DoCmd.OpenForm stDocName, , , , , acDialog
Me.Visible = True
Exit_Command48_Click:
Exit Sub
Err_Command48_Click:
MsgBox Err.Description
Resume Exit_Command48_Click
End Sub
-------------------------------
Private Sub Command14_Click()
On Error GoTo Err_Command14_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Christmas Dinner Menu"
Me.Visible = False
DoCmd.OpenForm stDocName, , , , , acDialog
Me.Visible = True
Exit_Command14_Click:
Exit Sub
Err_Command14_Click:
MsgBox Err.Description
Resume Exit_Command14_Click
End Sub
-------------------------------------------
Private Sub Command2_Click()
On Error GoTo Err_Command2_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Event selector"
DoCmd.Close acForm, Me.Name, acSaveNo
Exit_Command2_Click:
Exit Sub
Err_Command2_Click:
MsgBox Err.Description
Resume Exit_Command2_Click
End Sub
-------------------------------------------
Private Sub Main_Window_Click()
On Error GoTo Err_Main_Window_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Main Menu"
DoCmd.OpenForm stDocName, , , , , acDialog
DoCmd.Close acForm, Me.Name, acSaveNo
Exit_Main_Window_Click:
Exit Sub
Err_Main_Window_Click:
MsgBox Err.Description
Resume Exit_Main_Window_Click
End Sub
--------------------------------------------------
Is all of that code in one form? The Main_Window_Click() code is opening a form in Dialog mode and then closing the current form; not a good idea.