From: Iram on
Hello,

I have a form called "frm_AddRegistration" and it's Data Entry setting set
to "Yes" in it's form properties. I access this form through the Switchboard
in Add Mode.

If I wanted to open this same form and change it's Data Entry setting to
"No" by using a command button on a different form (other than the
switchboard) how would I code the VBA?

....And On Close of the "frm_AddRegistration" form how would I code it to
change the Data Entry back to "Yes"? I need it to revert back to Yes since I
access it from the Switchboard to add records in Data Entry mode.

Your help is greatly appreciated.


Thanks.
Iram/mcp
From: PieterLinden via AccessMonster.com on
Iram wrote:
>Hello,
>
>I have a form called "frm_AddRegistration" and it's Data Entry setting set
>to "Yes" in it's form properties. I access this form through the Switchboard
>in Add Mode.
>
>If I wanted to open this same form and change it's Data Entry setting to
>"No" by using a command button on a different form (other than the
>switchboard) how would I code the VBA?
>
>...And On Close of the "frm_AddRegistration" form how would I code it to
>change the Data Entry back to "Yes"? I need it to revert back to Yes since I
>access it from the Switchboard to add records in Data Entry mode.
>
>Your help is greatly appreciated.
>
>Thanks.
>Iram/mcp

This doesn't make much sense. You can change the DataEntry property of the
form when you open it... why do you need to change it on the close event?
Because you're letting users see the database window? Don't do that.
Problem solved.

Private Sub cmdOpenFormDEYes_Click()
On Error GoTo Err_cmdOpenFormDEYes_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Case"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Forms(stDocName).DataEntry = True '<-- Now form opens for Data entry....

Exit_cmdOpenFormDEYes_Click:
Exit Sub

Err_cmdOpenFormDEYes_Click:
MsgBox Err.Description
Resume Exit_cmdOpenFormDEYes_Click

End Sub

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201005/1