Hello,
I am wondering the following question.
In my database i used the 'default' Access switchboard as start-up form. This switchboard has many buttons and menus. 2 of those open the same form in different state.
example: button 1 opens form Jobs in 'Add Mode'
Button 2 opens form Jobs in 'Edit State'
each button is connected to a different macro, that each run a seperate module that open the same form 'frmJobs' in diferrent states, Add or Edit.
My question is as follow: I would like to be able to use these same modules, but to open a different form the same way has i open frmJobs.
Here are the modules that the 2 different macro's run:
Add mode
Edit mode
Is there a way to find out where the click event took place from the Access switchboard to be able to change dinamically the 'stDocName'?
Thanks,
Sylvain
I am wondering the following question.
In my database i used the 'default' Access switchboard as start-up form. This switchboard has many buttons and menus. 2 of those open the same form in different state.
example: button 1 opens form Jobs in 'Add Mode'
Button 2 opens form Jobs in 'Edit State'
each button is connected to a different macro, that each run a seperate module that open the same form 'frmJobs' in diferrent states, Add or Edit.
My question is as follow: I would like to be able to use these same modules, but to open a different form the same way has i open frmJobs.
Here are the modules that the 2 different macro's run:
Add mode
Code:
Public Function OpenFormAdd()
Dim State As Integer
Dim stDocName As String
stDocName = "frmJobs"
DoCmd.OpenForm stDocName, , , , acFormAdd
'MsgBox "open in add mode"
'Forms!frmJobs.cmdSearch.Visible = False
Forms!frmJobs.Text179.Value = 0
Forms!frmJobs.cmdSearch.Visible = False
End Function
Code:
Public Function OpenFormEdit()
Dim State As Integer
Dim stDocName As String
stDocName = "frmJobs"
DoCmd.OpenForm stDocName, , , , acFormEdit
'MsgBox "open in add mode"
Forms!frmJobs.JobNumber.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
Forms!frmJobs.cmdNew.Visible = False
Forms!frmJobs.Text179.Value = 1
Forms!frmJobs.Label95.Caption = "Search Form"
Forms!frmJobs.CustomerType.Locked = True
DoCmd.GoToRecord , , acFirst
If Forms!frmJobs.Text179 = 1 Then
Forms!frmJobs.cmdCancel.Enabled = True
End If
End Function
Thanks,
Sylvain