Help With Access 2003 VBA Enable Function

spike250

Registered User.
Local time
Today, 13:13
Joined
Aug 6, 2009
Messages
70
Hi All,

I have the following code behind the OnForm Open Event
Private Sub Form_Open(Cancel As Integer)
Me.Date.Enabled = False
Me.C.Enabled = False
Me.V.Enabled = False
Me.Old_K.Enabled = False
Me.D.Enabled = False
End Sub

And On the command button to add new record I have the opposite to enable each field.

The problem I am having that the code above is only disabling the first line, how can I get it to move down each line in turn?

Any help would be appreciated.

Spike
:confused::confused::confused:
 
Are you using a continuous form which is bound to your recordset?
 
Hi,

No I'm Using A Single Form.

Spike
 
So when you say it's disabling the first line what do you mean?
 
Sorry but I do not agree with your naming conventions. To others reading your code this is very confusing, also naming a field/control Date is a big no no this is an Access reserved word. Change it straight away.

Set the enabled property to False in the control properties and only enable via you command button.
 
Hi,

Thanks to those who replied.

I managed to get it to work by,

1. Changing enabled option under the Data Properties of the field to NO
2. Adding the following to the Add New Record Command Button;
Me.DateScanned.Enabled = True
Me.C.Enabled = True
Me.V.Enabled = True
Me.Old_K.Enabled = True
Me.D.Enabled = True

It now works fine.

P.S. I have changed the name from Date to DateScanned thanks for the information.

Spike
 
Your names should be descriptive, so try to use more intuitive names to replace the below.

Me.C.Enabled = True
Me.V.Enabled = True
Me.Old_K.Enabled = True
Me.D.Enabled = True

You're welcome. Glad you got it working.
 

Users who are viewing this thread

Back
Top Bottom