From: Iram on
I am using Access 2003. I need some help creating code to turn "Data Entry"
Off upon opening a form and upon closing turning it back on.

The reason why I need this is because from the switchboard I access a form
"frm_AltaDeRegistrosPagina1-2Analista" that I normally want "Data Entry" on
by default. But when I access the same form
"frm_AltaDeRegistrosPagina1-2Analista" from a different form "frm_Analista" I
want to turn off the Data Entry so that I can view the data.

I figure I would put your code on the button that I use on form
"frm_Analista" on the On Click event to do something like

On form "frm_AltaDeRegistrosPagina1-2Analista" Date Entry = False .

Then on the On Close Event of "frm_AltaDeRegistrosPagina1-2Analista"

there would be something like Me.Data Entry = True

Can you please help me?

From: PieterLinden via on
You could either set the DataEntry property of the form, or better, open the
form in the various modes.
Private Sub cmdOpenInDataEntryMode_Click()
On Error GoTo Err_cmdOpenInDataEntryMode_Click

Dim stDocName As String

stDocName = "Form1"
'opens the form in data entry mode (so can only add records - cannot see
added records)
DoCmd.OpenForm stDocName, acViewNormal, , , acFormAdd, acWindowNormal
'opens the form in edit mode (so can see existing records and edit them)
DoCmd.OpenForm stDocName, acViewNormal, , , acFormEdit, acWindowNormal

Exit Sub

MsgBox Err.Description
Resume Exit_cmdOpenInDataEntryMode_Click

End Sub

Message posted via