De-activating a combo box

mlopes1

Registered User.
Local time
Yesterday, 22:04
Joined
Sep 4, 2002
Messages
76
I have user form where products for an order are entered. 1 record per product entered. The first field is a combo box where a company is chosen. Then a combo box for the product.
After the first product is entered, I would like for the company combo box to not be editable. Other words, once the company is chosen, all products entered are assumed to be for that company, so user should not have option to change it.


Simple as usual, but help is much appreciated.


Marco
 
Lookup the "lock" property. You can lock the combo box (make it non-updateable) and the event of your choice. They unlock it when you really want it to change.
 
Yes, thank you. I see lock property. But what event signal that the current record is no longer the first one? I want it locked for records 2 and higher, but updateable for the first record of the order. Sorry if very simple!
 
On product combo box, after update, lock company company combo box.

Your next quertrion is the event on which to unlock the company combo box. Maybe a special button for that purpose. Consider changing the backcolor of the company combo box, depending on whether it's lock or unlocked, e.g.

on cboProduct_AfterUpdate
cbocompany.lock=true
cbocompany.backcolor= (you specifiy the color number, a shade of red?)

On event where company cbo needs to be unlocked -
cbocompany.lock=false
cbocompany.backcolor= (you specifiy another color number, the normal form field background color, white?, grey?)
 
Perfecto! I now just add a button that says "Change company" to unlock it. Originally I did not want it to lock just on afterUpdate, in case they make an error. But it so simple to add an "unlock", that I will. Thank you very much!
 

Users who are viewing this thread

Back
Top Bottom