View Single Post
  #4  
Old October 12th, 2009, 03:43 PM posted to microsoft.public.access.forms
alison.justice
external usenet poster
 
Posts: 40
Default Enable/Disable Control

Yes I was looking at the Event tab and did not see it listed, I'm using
Access 2007.

Thank you for the code, I tried to figure it out myself, but sometimes those
books don't help.

--
Alison


"Dirk Goldgar" wrote:

"alison.justice" wrote in message
...
I have a form that has a control named CategoryID, what I am trying to
accomplish is if the control has data in it then the data cannot be
changed,
but if there is no data in the control then it is available so I could
enter
information then once the data is entered it basically disable the control
how would I do this.

And on the property portion of the form is there an OnCurrent in Access
2007
I don't see it?



There certainly is. Are you looking at the Events tab of the property
sheet? Access 2007 did reorder some of the properties, IIRC, but it didn't
take away the Current event or the On Current property.

You're right to be thinking of the Current event. I'd use code like this
for the Current event:

'------ start of example code ------
Private Sub Form_Current()

Me.CategoryID.Enabled = IsNull(Me.CategoryID)

End Sub
'------ end of example code ------

--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)