Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2004
    Posts
    15

    Unanswered: display history data in MSHFlexGrid

    hi,
    i have a problem where 3 text box that will receive a serial no., location and pin no. .all the data that i key-in will display in the MSHFlexgrid. But i want to show all the history information of the serial no. example: if i key-in serial no.=123456 so in the MSHFlexgrid, it will dispaly all the history data of the serial no. can you tell me how to do it? if possible show me the coding..
    thank you.

  2. #2
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    It would be difficult to discuss this without knowing how the history data is stored.

    Essentially, you need to

    a) Declare an ADO connection to the database and an ADO recordset
    b) Build an SQL Query to retrieve the data needed
    c) Execute the query to populate the recordset
    d) Copy the data from the recordset to the mshFlexgrid.
    e) close the recordset and connection and release their resources.


    Here's a good beginners VB/ADO Tutorial. In addition, here is a good set of flexgrid functions that can be easily adapted to your needs.
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


  3. #3
    Join Date
    Aug 2004
    Posts
    15

    re:display history data in MSHFlexGrid

    hi,
    i tried to make the coding but i have not yet try it. can you please check for me the coding? if there any mistake can you correct it for me?

    Dim cn As New ADODB.Connection
    Dim rs As New ADODB.Recordset
    Dim sql1 As String

    Private Sub txtSerialNo_Change()
    sql1="select * from master_pcba_debug where serialno LIKE 'XM%'"
    cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\pcba debug system\debug.mdb;Persist Security Info=False"
    rs.CursorLocation=adUseClient
    rs.Open sql1,cn,adopenForwardonly,adLockReadOnly
    With Adodc1.rs
    !serialno = txtSerialNo
    !defcausemode = cboDefect.Text
    !pinno = cboPinNo.Text
    !componentpno = txtICPN
    !iclotcode = txtNewLC
    !TimeStamp = lblTime
    !remark = txtFailure
    !reworkact = cboRework.Text
    !componentloc = cboLoc.Text
    .Requery
    End With
    Adodc1.Refresh
    Set MSHFlexGrid1.DataSource = Adodc1
    MSHFlexGrid1.FormatString = "Serial No. | Defect Mode | Location | Pin # | Rework Action | Failure | IC Part No. | New Lot Code | Test Time"
    cn.Close
    rs.Close
    End Sub

    I hope that you can help solve this problem. i need it URGENT!
    tahnk you.

  4. #4
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    In the sql assignment, you are specifying that you wish to see all records where the serial number begins with XM.

    If you want to return all records where the serial number is 123456, then

    sql1="select * from master_pcba_debug where serialno = '123456'" (assuming that the serial number field is a string data type (Varchar, etc.)

    Secondly; why are you changing the data within the current record before trying to populate the flexgrid?

    Take a look HERE for example mshFlexGrid code.
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


Posting Permissions

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