| | |
some help
![]() |
•
•
Join Date: Dec 2008
Posts: 292
Reputation:
Solved Threads: 1
Sir when i click on grid i got error memeber or data memebr not found and cursor goes on grd_leavecell() event
Kindly help me i also send production_tabletest.mdb .
Private Sub Grd_LeaveCell()
Dim strOldValue As String
On Error GoTo Grd_LeaveCell_Error
If Grd.Col < GRID_COL_OFFSET Then GoTo Grd_LeaveCell_Done
If FlexGridEditor.Visible Then
strOldValue = Grd
Grd = FlexGridEditor.Value
FlexGridEditor.Visible = False
If Grd.Col = cItemCode Then
Call SetProductValues
End If
If Grd.Col >= GRID_COL_OFFSET Then
If Grd.Col < MAX_GRD_COLS - 1 Then
Grd.Col = Grd.Col + 1
ElseIf Grd.Col = MAX_GRD_COLS - 1 Then
If Val(Grd.TextMatrix(Grd.Row, cQty)) = 0 Then
If Trim$(Grd.TextMatrix(Grd.Row, cItemCode)) = "" Or Val(Grd.TextMatrix(Grd.Row, cQty)) = 0 Then
'do nothing
Else
If Grd.Row = Grd.Rows - 1 Then
Grd.AddItem ""
Grd.TextMatrix(Grd.Rows - 1, cSlno) = Grd.Rows - 1
End If
If Grd.Row < Grd.Rows - 1 Then
Grd.Row = Grd.Row + 1
End If
End If
ElseIf Val(Grd.TextMatrix(Grd.Row, cQty)) = 0 Or Trim$(Grd.TextMatrix(Grd.Row, cItemCode)) = "" Then
'Do Not Increment Row
Else
If Grd.Row = Grd.Rows - 1 Then
Grd.AddItem ""
Grd.TextMatrix(Grd.Rows - 1, cSlno) = Grd.Rows - 1
End If
If Grd.Row < Grd.Rows - 1 Then
Grd.Row = Grd.Row + 1
End If
End If
Grd.Col = GRID_COL_OFFSET
If Grd.ColIsVisible(Grd.Col) = False Then Grd.LeftCol = Grd.Col
End If
End If
End If
Grd_LeaveCell_Done:
Exit Sub
Grd_LeaveCell_Error:
Call Process_Error(MODULE_NAME, "grd_LeaveCell")
Resume Grd_LeaveCell_Done
End Sub
Private Sub SetProductValues()
Dim rs As New ADODB.Recordset
On Error GoTo SetProductValues_Error
rs.Open " SELECT ITEM_CODE, PRODUCTNAME, UNIT FROM PARTDETAIL WHERE ITEM_CODE = '" & Grd.TextMatrix(Grd.Row, cItemCode) & "' ", con, adOpenKeyset, adLockReadOnly
If rs.BOF = False Then
Grd.TextMatrix(Grd.Row, cItemName) = rs!ProductName
Grd.TextMatrix(Grd.Row, cUnit) = rs!UNIT
End If
SetProductValues_Done:
If rs.State Then rs.Close
Set rs = Nothing
Exit Sub
SetProductValues_Error:
Call Process_Error(MODULE_NAME, "SetProductValues")
Resume SetProductValues_Done
End Sub
Private Sub FlexGridEditor_KeyDown(KeyCode As Integer, Shift As Integer)
Dim OldValue As Variant
On Error GoTo FlexGridEditor_KeyDown_Error
Select Case KeyCode
Case vbKeyEscape:
FlexGridEditor.Visible = False
Grd.SetFocus
Case vbKeyReturn:
Grd.SetFocus
End Select
FlexGridEditor_KeyDown_Done:
Exit Sub
FlexGridEditor_KeyDown_Error:
Call Process_Error(MODULE_NAME, "FlexGridEditor_KeyDown")
Resume FlexGridEditor_KeyDown_Done
End Sub
Kindly help me i also send production_tabletest.mdb .
Private Sub Grd_LeaveCell()
Dim strOldValue As String
On Error GoTo Grd_LeaveCell_Error
If Grd.Col < GRID_COL_OFFSET Then GoTo Grd_LeaveCell_Done
If FlexGridEditor.Visible Then
strOldValue = Grd
Grd = FlexGridEditor.Value
FlexGridEditor.Visible = False
If Grd.Col = cItemCode Then
Call SetProductValues
End If
If Grd.Col >= GRID_COL_OFFSET Then
If Grd.Col < MAX_GRD_COLS - 1 Then
Grd.Col = Grd.Col + 1
ElseIf Grd.Col = MAX_GRD_COLS - 1 Then
If Val(Grd.TextMatrix(Grd.Row, cQty)) = 0 Then
If Trim$(Grd.TextMatrix(Grd.Row, cItemCode)) = "" Or Val(Grd.TextMatrix(Grd.Row, cQty)) = 0 Then
'do nothing
Else
If Grd.Row = Grd.Rows - 1 Then
Grd.AddItem ""
Grd.TextMatrix(Grd.Rows - 1, cSlno) = Grd.Rows - 1
End If
If Grd.Row < Grd.Rows - 1 Then
Grd.Row = Grd.Row + 1
End If
End If
ElseIf Val(Grd.TextMatrix(Grd.Row, cQty)) = 0 Or Trim$(Grd.TextMatrix(Grd.Row, cItemCode)) = "" Then
'Do Not Increment Row
Else
If Grd.Row = Grd.Rows - 1 Then
Grd.AddItem ""
Grd.TextMatrix(Grd.Rows - 1, cSlno) = Grd.Rows - 1
End If
If Grd.Row < Grd.Rows - 1 Then
Grd.Row = Grd.Row + 1
End If
End If
Grd.Col = GRID_COL_OFFSET
If Grd.ColIsVisible(Grd.Col) = False Then Grd.LeftCol = Grd.Col
End If
End If
End If
Grd_LeaveCell_Done:
Exit Sub
Grd_LeaveCell_Error:
Call Process_Error(MODULE_NAME, "grd_LeaveCell")
Resume Grd_LeaveCell_Done
End Sub
Private Sub SetProductValues()
Dim rs As New ADODB.Recordset
On Error GoTo SetProductValues_Error
rs.Open " SELECT ITEM_CODE, PRODUCTNAME, UNIT FROM PARTDETAIL WHERE ITEM_CODE = '" & Grd.TextMatrix(Grd.Row, cItemCode) & "' ", con, adOpenKeyset, adLockReadOnly
If rs.BOF = False Then
Grd.TextMatrix(Grd.Row, cItemName) = rs!ProductName
Grd.TextMatrix(Grd.Row, cUnit) = rs!UNIT
End If
SetProductValues_Done:
If rs.State Then rs.Close
Set rs = Nothing
Exit Sub
SetProductValues_Error:
Call Process_Error(MODULE_NAME, "SetProductValues")
Resume SetProductValues_Done
End Sub
Private Sub FlexGridEditor_KeyDown(KeyCode As Integer, Shift As Integer)
Dim OldValue As Variant
On Error GoTo FlexGridEditor_KeyDown_Error
Select Case KeyCode
Case vbKeyEscape:
FlexGridEditor.Visible = False
Grd.SetFocus
Case vbKeyReturn:
Grd.SetFocus
End Select
FlexGridEditor_KeyDown_Done:
Exit Sub
FlexGridEditor_KeyDown_Error:
Call Process_Error(MODULE_NAME, "FlexGridEditor_KeyDown")
Resume FlexGridEditor_KeyDown_Done
End Sub
![]() |
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: showing specific records using vb6 datareport
- Next Thread: data report designer or access reports ?
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





