Turning on and off Data Entry

I

Iram

Hello,
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?


Thanks.
Iram/mcp
 
P

PieterLinden via AccessMonster.com

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"
'--COMMENT OUT THE METHOD YOU DON'T WANT...
'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_cmdOpenInDataEntryMode_Click:
Exit Sub

Err_cmdOpenInDataEntryMode_Click:
MsgBox Err.Description
Resume Exit_cmdOpenInDataEntryMode_Click

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top