A
Amir
Hi!
I have a continous form with some fields, like: ProductKeyInReceipt,
Diameter etc.
I want the Diameter field to not be locked only if the product that the user
selects from the ProductKeyInReceipt should have a diameter (otherwise I
want it to be 0). In addition I want the combobox of the diameter to change
it's color due to the selection in the ProductKeyInReceipt combobox (so that
the color will 'tell' the user if this product should have a diameter or
not).
Here is the solution I've used:
In the both the Form_Current event and in the
ProductKeyInReceipt_AfterUpdate event I used the following code:
If Me!ProductKeyInReceipt.Column(3) = False Then
' Column(3) is a boolean value which
'tells if the product should have a diameter or not.
Me!Diameter.BackColor = 9009253
Me!Diameter.ForeColor = 14935011
Me!Diameter.Value = 0
Me!Diameter.Enabled = False
Me!Diameter.Locked = True
Else
Me!Diameter.BackColor = 15723495
Me!Diameter.ForeColor = 0
Me!Diameter.Enabled = True
Me!Diameter.Locked = False
Me!ProductKeyInReceipt.SetFocus
End If
This works fine in single form, but when I change the form's design to
continous form, this code changes the colors of ALL the records in the view,
instead of changing only the colors in the record the user is currently
editing.
How can I make it change only the current record's colors?
I remember I once heard of a solution to this problem using unbounded
textboxes that are 'on' the bounded comboboxes and copy their value from the
bound comboboxes so they don't change their color when the value changes,
but I don't remember how to do that..
I will be grateful if anyone could answer this (using the solution I've
mentioned or any other solution you might think of..)
Thank you very much!
Regards,
Amir.
I have a continous form with some fields, like: ProductKeyInReceipt,
Diameter etc.
I want the Diameter field to not be locked only if the product that the user
selects from the ProductKeyInReceipt should have a diameter (otherwise I
want it to be 0). In addition I want the combobox of the diameter to change
it's color due to the selection in the ProductKeyInReceipt combobox (so that
the color will 'tell' the user if this product should have a diameter or
not).
Here is the solution I've used:
In the both the Form_Current event and in the
ProductKeyInReceipt_AfterUpdate event I used the following code:
If Me!ProductKeyInReceipt.Column(3) = False Then
' Column(3) is a boolean value which
'tells if the product should have a diameter or not.
Me!Diameter.BackColor = 9009253
Me!Diameter.ForeColor = 14935011
Me!Diameter.Value = 0
Me!Diameter.Enabled = False
Me!Diameter.Locked = True
Else
Me!Diameter.BackColor = 15723495
Me!Diameter.ForeColor = 0
Me!Diameter.Enabled = True
Me!Diameter.Locked = False
Me!ProductKeyInReceipt.SetFocus
End If
This works fine in single form, but when I change the form's design to
continous form, this code changes the colors of ALL the records in the view,
instead of changing only the colors in the record the user is currently
editing.
How can I make it change only the current record's colors?
I remember I once heard of a solution to this problem using unbounded
textboxes that are 'on' the bounded comboboxes and copy their value from the
bound comboboxes so they don't change their color when the value changes,
but I don't remember how to do that..
I will be grateful if anyone could answer this (using the solution I've
mentioned or any other solution you might think of..)
Thank you very much!
Regards,
Amir.