Conditional Format New Record

T

talibm

Hello Access Nation,

I have a form that is used for interviewing prospective employees. It has a
checkbox pos_acpt. and a corresponding textbox reas_decl. If the pos_acpt
checkbox is checked the reas_decl textbox enabled is set to false. The code
that I used works fine except when I go to a new record. This is the code
that I have in form load and current and pos_acpt before update and
afterupdate.

If Me.Accpt_pos.Value = 0 Then
Me.Reason_declined.Enabled = True
Else
Me.Reason_declined.Enabled = False

End If

I can't figure out why it doesnt work for a new record. Any help is always
appreciated. thanks tm
 
K

Klatuu

This should be the code for your current event.

If Me.NewRecord Then
Me.Reason_declined.Enabled = False
Else
Me.Reason_declined.Enabled = Me.Accpt_pos = 0
End If

Note. It is not necessary to use the Value property explicitly. It is the
default property.
Me.Accpt_pos.Value = 0
and
Me.Accpt_pos = 0
are really the same
 

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