I have a datagrid (dgReports) which is bound to an ado (adoProductionReports) control. I have certain columns that can be edited. On my datagrid's keypress event I check for the "enter" key and if that is pushed I update my database.
like this:
Private Sub dgReports_KeyPress(KeyAscii As Integer)
'check if enter has been pressed and update recordset...
If KeyAscii = 13 Then
Me.adoProductionReports.Recordset.Update
End If
End Sub
After the update event has completed I catch the event and update several other tables in my database. Like this:
Private Sub adoProductionReports_RecordChangeComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal cRecords As Long, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
'print out 3 copies of report
Select Case adReason
Case adRsnUndoAddNew, adRsnUndoUpdate, adRsnFirstChange
'do nothing
Case Else
msgbox "update complete"
End Select
End Sub
now my question is...I have to press enter twice to see the update complete msgbox, why is that? I want to have my users just have to push enter once and it will update...and then run my other updates which replaces that msgbox.
I'm using ado 2.6 and vb6
thanks for any insight
like this:
Private Sub dgReports_KeyPress(KeyAscii As Integer)
'check if enter has been pressed and update recordset...
If KeyAscii = 13 Then
Me.adoProductionReports.Recordset.Update
End If
End Sub
After the update event has completed I catch the event and update several other tables in my database. Like this:
Private Sub adoProductionReports_RecordChangeComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal cRecords As Long, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
'print out 3 copies of report
Select Case adReason
Case adRsnUndoAddNew, adRsnUndoUpdate, adRsnFirstChange
'do nothing
Case Else
msgbox "update complete"
End Select
End Sub
now my question is...I have to press enter twice to see the update complete msgbox, why is that? I want to have my users just have to push enter once and it will update...and then run my other updates which replaces that msgbox.
I'm using ado 2.6 and vb6
thanks for any insight