Results 1 to 2 of 2

Thread: How to display this problem in MSHFlexgrid?

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2010
    Posts
    53

    How to display this problem in MSHFlexgrid?

    I have 2 tables,
    1st table:ITEM(ITEM_NO, ITEM_NAME, ITEM_SIZE, ITEM_QHAND, ITEM_RPRICE)
    2nd table: STRUCTURE(STR_ITEMNO, STR_FLOWER, STR_QTY)

    and i wanna display the STR_ITEMNO, ITEM_NAME, STR_QTY
    BUT NOTE: ITEM_NAME WILL DEPEND ON THE STR_ITEMNO BECAUSE ITEMNO IS A FOREIGN KEY...
    HERE IS MY CODE IN POPULATE FUNCTION
    Code:
     Dim rs As New ADODB.Recordset
        Dim sqlStr As String
            sqlStr = "Select STR_ITEMNO,ITEM_NAME,STR_QTY from STRUCTURE,ITEM  "
            rs.Open sqlStr, Conn, adOpenForwardOnly, adLockReadOnly
                
                If Not rs.EOF Then
                    MSHItemStructure.FixedCols = 0
                    Set MSHItemStructure.Recordset = rs
                    With MSHItemStructure
                        FormatString = "ITEM NUMBER|FLOWER ID|QUANTITY"
                    
                        .ColWidth(0) = 1450
                        .ColWidth(1) = 2200
                        .ColWidth(2) = 1300
                    
                        
                          .AllowUserResizing = flexResizeColumns
                          .SelectionMode = flexSelectionByRow
                          
                 End With
                    MSHItemStructure.Enabled = True
                 Else
                     
                    MSHItemStructure.FixedCols = 0
                    With MSHItemStructure
                        FormatString = "ITEM NUMBER|FLOWER ID|QUANTITY"
                    
                        .ColWidth(0) = 1000
                        .ColWidth(1) = 1000
                        .ColWidth(2) = 1000
                    
                    
    '               MSHItemStructure.TextMatrix(1, 0) = ""
    '               MSHItemStructure.TextMatrix(1, 1) = ""
    '               MSHItemStructure.TextMatrix(1, 2) = ""
                    
                    End With
                    MSHItemStructure.Enabled = False
                End If

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: How to display this problem in MSHFlexgrid?

    Research the SQL Join clauses.

    In this case the SQL would be

    Select STR_ITEMNO,ITEM_NAME,STR_QTY
    From STRUCTURE Inner Join ITEM On Structure.str_ItemNo = Item.Item_No

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width