Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Janus GridEx

Status
Not open for further replies.

bradth

IS-IT--Management
Feb 18, 2005
142
CA
I currently have a form created that displays information into a grid, using Janus GridEx 2000. However whenever the data is loaded into the grid, the first row is always blank. Then when you select a new row, and then re-select the first row, the data appears. Is there any reason for this, or a way to eliminate it so that the data in the first row appears automatically without having to select/reselect it? Thanks.
 
My code is really long, a few pages. For some reason the grid will not refresh for me either, I have to click inside the grid to get it to refresh when new data is imported into it with new parameters.
 
Can you put just the gist of the code like

csql = "select OrderEntryId , DeliveryNote , POD ,ID,LockOrderPod AS Received,ProcessedName , ProcessedDepot , ProcessedDateTime , PostDate, EnteredVia"
csql = csql & " from Delivery "
csql = csql & " where OrderEntryId = " & lOrderEntryId & " AND PostDate is null"
csql = csql & " ORDER BY DeliveryNote"
adoSecondaryRS.Open csql, db, adOpenStatic, adLockOptimistic

Set GridEX2.ADORecordset = adoSecondaryRS
Gridex2Formatting


 
Ok, here it is

Code:
Private Sub mnuVR_Click()

Me.grdInvItemQty.ItemCount = 0
mRowCount = 0
ReDim mIndexCompleteArray(0)

Dim cnItem As ADODB.Connection
Dim rsItem As ADODB.Recordset

Set cnItem = New ADODB.Connection
Set rsItem = New ADODB.Recordset

If Me.chkLocation.Value Then
    j = Me.cboLocation.List(Me.cboLocation.ListIndex)
Else
    j = ""
End If

If Me.txtInvQty.Enabled Then
    k = Me.txtInvQty.List(Me.txtInvQty.ListIndex)
Else
    k = ""
End If

cnItem.Open gsSQLConnect
cnItem.CursorLocation = adUseClient
Screen.MousePointer = vbHourglass

'--Inserts Items Into Grid
rsItem.Open "Barcode.dbo.INV_RO_ALLITEMNUMBERS('" & j & "','" & k & "')", cnItem, adOpenForwardOnly, adLockReadOnly, adCmdStoredProc
'rsItem.Open "Barcode.dbo.INV_RO_ALLITEMNUMBERS('" & Me.cboLocation.List(Me.cboLocation.ListIndex) & "')", cnItem, adOpenForwardOnly, adLockReadOnly, adCmdStoredProc
Set rsItem.ActiveConnection = Nothing

mintItem = 0
    If rsItem.EOF Then
        Me.grdInvItemQty.ItemCount = 0
        mRowCount = 0
    Else
        i = 1
        rsItem.MoveFirst
                
        Do Until rsItem.EOF
            If i > 1 Then
                ReDim Preserve mIndexCompleteArray(i)
            Else
                ReDim mIndexCompleteArray(i)
            End If
    
    mIndexCompleteArray(i).ITEMNMBR = rsItem!ITEMNMBR
    mIndexCompleteArray(i).ITEMDESC = rsItem!ITEMDESC
    mIndexCompleteArray(i).QTYONHND = rsItem!QTYONHND
    mIndexCompleteArray(i).LOCNCODE = rsItem!LOCNCODE

        i = i + 1
        rsItem.MoveNext
        Debug.Print "i is" & i
    Loop
    rsItem.Close
    Set rsItem = Nothing
    cnItem.Close
    Set cnItem = Nothing
    i = i - 1
    Me.grdInvItemQty.ItemCount = i
    
    mRowCount = i
    Screen.MousePointer = vbDefault
    End If
End Sub

The grdInvItemQty is the JanusGridEx 2000.


Thanks [spidey]
 
HAHA, I finally got it, it was that I was setting my
Code:
mRowCount = 0
and really I should of had it
Code:
mRowCount = 1

Thanks for you help though. Cheers [spidey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top