Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable a field in a specific record but keep it otherwise enabled

Status
Not open for further replies.

MattMeat

Programmer
Nov 6, 2001
38
US
Hello Everyone,

I am still making a Service Order Entry Form for our warehouse here at work. The last text field on the bottom of the form is called "Memo". Right under the "memo" field is a combo box with employee intitials. First, I needed to get the "memo" field to disable when the combo box (below) was changed. After doing that, I learned that I had disabled the field for every record. Basically, I would like to know how to disable the "memo" field in a specific record (whatever record is showing). Thank you very much!

Matt
 
in the froms on current event reenable it me.memofield.enabled = true

you see it is sorta like a loop

The from opens to the record. the property is enabled. you change the field it is disabled. Move to the next record enabled again.

or you can do something like this on the forms on current
if me.inital field = "" then
me.memo1.enabled = true
else
memo1.enabled = false
end if

good luck


 
Hello Braindead2!

This worked great! But I also wanted to know if there was a way to keep the "memo" field of a specific record disabled indefinitely while the others are enabled. For example, If I am scrolling through the records, the "memo" fields that have been disabled should remain that way. As it is now, the field only stays disabled until I come back to it. Basically, I want the field to be disabled so that a user can not re-enter data into this field (disabled only on the record that is showing).

Matt
 
Maybe I am not reading your problem correctly, but if you want the memo field to be disabled then just set the Enabled property of the field to "No". If you want to disable it after the user selects something from the combo box then do it on the On Change event i.e.
Private Sub Combo_Change()
MemoFieldName.Enabled = False
End Sub

You could also consider locking the memo field as well so the user cannot make any changes

HTH,
JC
 
Thanks Mongooses,

The other thing I was trying to explain was this:
Let's say the user just locked/disabled the "memo" field in ServiceOrderNo "37" (Autonumber )by making a change in a combo box. The "memo" field in my form does lock, which is what I want. And when I move to another record The memo field is available for data entry again. Which is also what I want. The problem is that I want to lock the "memo" field in record "37" forever...Everytime that record comes up, the "memo" field should be locked. Right now, when I come back to "37" the "memo" field is available again because of the loop that I have on it. Basically, the user should get only one chance to write in the "memo" field. This field (memo) should be available for entry in all the other records until the lock has been applied. I need some more code to make this work.

Thanks a Lot,
Matt
 
Matt look at the code I put above if you change it a little and place this in the forms on current event it should work

if me.memo1 = "" then
me.memo1.enabled = true
else
memo1.enabled = false
end if
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top