Question : Access 2007 disabling text box control on form load

Hello,

I have a form created in Access 2007 that upon opening, would like the textbox fields to be uneditable.  I tried referring to each control as shown in the code below and setting the enabled property to false.

The form's recordsource refers to an Access table and each control refers to a column in that table.

When I open the form though I expected that the "Form_Open" event code would run and that each of these text boxes would turn grey and be uneditable but this doesn't seem to be working.  

Can someone advise on what I'm doing wrong here?   Thanks!

Code Snippet:
1:
2:
3:
4:
5:
6:
Private Sub Form_Open(Cancel As Integer)
Me.textbox1.Enabled = False
Me.textbox2.Enabled = False
Me.textbox3.Enabled = False
Me.textbox4.Enabled = False
End Sub

Answer : Access 2007 disabling text box control on form load

" Did you do anything else?   I realize that both the name and control source for each control (text box) were the same."

Yes ... and apparently in A2007 ... that is problematic.  It's always been problematic in Reports ... but as I understand it ... many things have been ... "tightened up" in A2007.

That's the only change I made.  IE ... I gave the Control Name property something different than the Control Source. I've done this since Access 1.0 .... *especially* on forms.

mx
Random Solutions  
 
programming4us programming4us