From: Iram on 7 Feb 2010 02:41 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
From: PieterLinden via AccessMonster.com on 7 Feb 2010 03:51 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 -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201002/1
|
Pages: 1 Prev: capturing the name of the active form in VBA Next: Round a number/ Access 2007 |