I shouldn't do air code.....
This changes the value for the data entry property:
Code:
Option Compare Database 'should ALWAYS have this line
Option Explicit 'should ALWAYS have this line
'Private Sub Command0_Click()
Dim CurrentStatus 'for debugging
Dim FormName As String
FormName = Me.cboObjectClassSelect
' DoCmd.OpenForm FormName, acDesign 'open visible for debugging
DoCmd.OpenForm Me.cboObjectClassSelect, acDesign, , , , acHidden
CurrentStatus = Forms(FormName).DataEntry 'for debugging
MsgBox Forms(FormName).DataEntry 'for debugging
'set property
'this toggles the TRUE/FALSE value
Forms(FormName).DataEntry = Not CurrentStatus 'for debugging
'these were for setting the value so I didn't have to type as much
' Forms(FormName).DataEntry = True
' Forms(FormName).DataEntry = False 'for debugging
MsgBox Forms(FormName).DataEntry 'for debugging
'close and save
DoCmd.Close acForm, FormName, acSaveYes
'End Sub
NOTE: if the form name selected in the combo box is currently open and visible, the form will be changed to design mode and hidden, then saved and closed.