G
Guest
Hi
I have the following code behind a command button which should open a second
form to a new record:
DoCmd.OpenForm "testfrm_PAI_2", , , , acFormAdd, , "Add"
The form is opening to a new record, but I cannot enter anything into any of
the text boxes. All controls are locked and unenabled in "View" or "Edit"
mode (other buttons on the switchboard, which are working fine), but I have
programmed the controls to be unlocked and enabled when in "Add" mode. When
the form is open, and on viewing the properties of the controls, they are
indeed unlocked and enabled, yet I cannot type anything in?
The following code is in the Form Open Event of testfrm_PAI_2:
Select Case Me.OpenArgs
Case "View"
'In "View" mode, Save/Cancel buttons invisible, Controls disabled
Call SaveCancelButtons_Off
Call Controls_Off
Case "Edit"
'In "Edit" mode, Exit/Edit buttons invisible, Controls enabled
Me.cmd_ExitForm.Visible = False
Me.lbl_ExitForm.Visible = False
Me.cmd_EditCert.Visible = False
Me.lbl_EditCert.Visible = False
Call Controls_On
Case "Add"
'In "Add" mode, Controls enabled, Exit/Edit/Del buttons disabled.
Call Controls_On
Me.cmd_ExitForm.Visible = False
Me.lbl_ExitForm.Visible = False
Me.cmd_EditCert.Visible = False
Me.lbl_EditCert.Visible = False
Me.cmd_DelCert.Visible = False
Me.lbl_DelCert.Visible = False
Me.cmd_CursorStop.SetFocus
Me.PAPOLICY_IDX.Enabled = True
Me.PAPOLICY_IDX.Locked = False
Me.PAPOLICY_IDX.SetFocus
Case Else
'Error message to go here
End Select
The procedures "Controls_On/Off" are basically only setting the Enabled and
Locked properties of various controls to True or False, depending on the
situation.
Is there something that I'm overlooking here that is causing the acFormAdd
to not let me enter anything in the controls?
Many thanks in anticipation of your help.
I have the following code behind a command button which should open a second
form to a new record:
DoCmd.OpenForm "testfrm_PAI_2", , , , acFormAdd, , "Add"
The form is opening to a new record, but I cannot enter anything into any of
the text boxes. All controls are locked and unenabled in "View" or "Edit"
mode (other buttons on the switchboard, which are working fine), but I have
programmed the controls to be unlocked and enabled when in "Add" mode. When
the form is open, and on viewing the properties of the controls, they are
indeed unlocked and enabled, yet I cannot type anything in?
The following code is in the Form Open Event of testfrm_PAI_2:
Select Case Me.OpenArgs
Case "View"
'In "View" mode, Save/Cancel buttons invisible, Controls disabled
Call SaveCancelButtons_Off
Call Controls_Off
Case "Edit"
'In "Edit" mode, Exit/Edit buttons invisible, Controls enabled
Me.cmd_ExitForm.Visible = False
Me.lbl_ExitForm.Visible = False
Me.cmd_EditCert.Visible = False
Me.lbl_EditCert.Visible = False
Call Controls_On
Case "Add"
'In "Add" mode, Controls enabled, Exit/Edit/Del buttons disabled.
Call Controls_On
Me.cmd_ExitForm.Visible = False
Me.lbl_ExitForm.Visible = False
Me.cmd_EditCert.Visible = False
Me.lbl_EditCert.Visible = False
Me.cmd_DelCert.Visible = False
Me.lbl_DelCert.Visible = False
Me.cmd_CursorStop.SetFocus
Me.PAPOLICY_IDX.Enabled = True
Me.PAPOLICY_IDX.Locked = False
Me.PAPOLICY_IDX.SetFocus
Case Else
'Error message to go here
End Select
The procedures "Controls_On/Off" are basically only setting the Enabled and
Locked properties of various controls to True or False, depending on the
situation.
Is there something that I'm overlooking here that is causing the acFormAdd
to not let me enter anything in the controls?
Many thanks in anticipation of your help.