Text box disable / enable on new record

  • Thread starter Thread starter John V
  • Start date Start date
J

John V

I have a text box on a form which holds the product ID.
The problem is, my users keep overwriting the product ID
instead of adding a product. This causes havoc in our
system.

I know I could give them two forms, one in add mode, the
other in edit mode and that is fine for some things, but
in this case I want the field disabled or locked when in
an existing record and enabled when adding a record.

Any clues?

Thanks in advance,

John
 
try

Private Sub Form_Current()

Me!NameOfTextbox.Locked = Not Me.NewRecord

End Sub

hth
 
This worked exactly as I needed...

Thank you VERY much...

I love solutions with just one line of code... LOL
 
one of the many handy little tricks that i've learned here in the
newsgroups. :)
 

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

Back
Top