'general declaration area
Dim strDBGridCell As String Private Sub DBGrid1_AfterColEdit(ByVal ColIndex As Integer) DBGrid1.Columns(ColIndex) = strDBGridCell End Sub Private Sub DBGrid1_BeforeColEdit(ByVal ColIndex As Integer, ByVal KeyAscii As Integer, Cancel As Integer) strDBGridCell = InputBox("Edit DBGrid Cell:", , DBGrid1.Columns(ColIndex)) End Sub 'Now whenever you attempt to edit any cell in the DBGrid, 'you'll see the InputBox prompt you for input. 'You can replace the InputBox with any other 'custom dialog you wish to build. It's easy to add custom input dialogs to al the cells in the Microsoft Data Bound Grid control. First, add a DBGrid control and Data control to your form. Next, set the DatabaseName and RecordSource properties of the data control to a valid database and table ("biblio.mdb" and "Publishers" for example). Then set the DataSource property of the DBGrid control to Data1 (the data control). Now add the following code to your form. |