Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
Disabling input on one row of a grid
I know I should be able to figure this out on my own...brainlock again...
I have a grid whose record source is a view of a table containing billing records. The grid columns contain text boxes and option groups. If the value in the date_billed column is empty, the item has not been billed and the user should be allowed to change values in all the other columns for that record. If there's a value in date_billed, the bill has been sent and user cannot edit anything in that record. The user should get a dialog box explaining why the record cannot be edited.
My question is, where to put the code to test for the value in date_billed, and what properties to set to disable editing in that row? I've experimented with code in the InteractiveChange method of each control, but that seems like too much code and the results are not exactly what I want. (For example, setting the readonly of a text box to true works fine--it affects only the current record-- but there is no readonly property for an optiongroup, and enabled = .f. affects all the rows.)
Is there something I can do at the grid level? Something tells me that I should use the AfterRowColChange event to test the value of date_billed, but I'm unsure what properties to set.
Sorry for the long description. Thanks,
Ross
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement