Ms Flexgrid vb6

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • macmypk
    New Member
    • Dec 2013
    • 4

    Ms Flexgrid vb6

    Dear Sir/mam
    I am making inventory management i have problem during when i update sale/purchase invoice it can not update sale/purchase invoice. my code is below please check it can you help me where is mistake and when i complie my programe it does not gives me any error
    please help me
    bir is msflexgrid
    i am writting code in vb6
    thanks
    mac

    Code:
    Private Sub Command4_Click()
    Dim dd1 As Database
    Dim mi1 As Recordset
    Dim mi2 As Recordset
    Dim count As Integer
    Dim gg As Variant
    dbname = App.Path + "\data\database.mdb"
    Set dd1 = OpenDatabase(dbname)
    Set mi1 = dd1.OpenRecordset("select * from purchase where purid= '" & Combo1.Text & "'")
    Set mi2 = dd1.OpenRecordset("select * from purchase where purid= '" & Combo1.Text & "'")
    bir.Row = 1
    bir.Col = 0
    If bir.Text = "" Then
    MsgBox "Please enter complete detail.", vbExclamation
    Else
    For count = 1 To bir.Rows - 2
    bir.Row = count
    mi1.Edit
    bir.Col = 0
    mi1.Fields("proid") = bir.Text
    bir.Col = 1
    mi1.Fields("name") = bir.Text
    bir.Col = 2
    mi1.Fields("packing") = bir.Text
    bir.Col = 3
    mi1.Fields("packtype") = bir.Text
    bir.Col = 4
    mi1.Fields("weight") = bir.Text
    bir.Col = 5
    mi1.Fields("ip") = bir.Text
    bir.Col = 6
    mi1.Fields("tp") = bir.Text ' purqty 'purbonus
    bir.Col = 7
    mi1.Fields("purqty") = bir.Text
    bir.Col = 8
    mi1.Fields("purbonus") = bir.Text
    bir.Col = 9
    mi1.Fields("disper") = bir.Text
    bir.Col = 10
    mi1.Fields("disrs") = bir.Text
    bir.Col = 11
    mi1.Fields("wto") = bir.Text
    bir.Col = 12
    mi1.Fields("total") = bir.Text
    bir.Col = 13
    mi1.Fields("discount") = bir.Text
    bir.Col = 14
    mi1.Fields("netamount") = Val(bir.Text)
    bir.Col = 15
    mi1.Fields("bonusamount") = Val(bir.Text)
    bir.Col = 16
    mi1.Fields("wtoamount") = Val(bir.Text)
    'bir.Col = 17
    mi1.Fields("purid") = Combo1.Text
    mi1.Fields("purdate") = Label2.Caption
    mi1.Fields("company") = Label6.Caption
    mi1.Fields("supaddress") = Label7.Caption
    mi1.Fields("supphone") = Label8.Caption
    mi1.Fields("supfax") = Label15.Caption
    mi1.Fields("supemail") = Label11.Caption
    mi1.Fields("supwebsite") = Label12.Caption
    mi1.Fields("groupname") = Label10.Caption
    mi1.Fields("guid") = Label16.Caption
    mi1.Fields("comid") = Label14.Caption
    mi1.Update
    Next
    bir.Clear
    bir.FormatString = "Item No | Item Name |Pack Size |Pack Type |Weight |I.Price |T.Price |Qty |Bonus |Dis % |Dis $ |W T O |TOTAL |DISCOUNT |NET AMOUNT |BONUS AMOUNT |WTO AMOUNT"
    bir.Rows = 2
    End If
    Unload Me
    Me.Show
    End Sub
  • zmbd
    Recognized Expert Moderator Expert
    • Mar 2012
    • 5501

    #2
    By, simply stating that your code "doesn't work," along with code that appears to have had very little if any troubleshooting performed, and expecting someone to help doesn't usually result in much of an answer.

    Instead please tell us what you were expecting to happen, what actually happened, what steps have YOU taken to trouble shoot the code.

    Comment

    • macmypk
      New Member
      • Dec 2013
      • 4

      #3
      Dear zmbd
      thanks for reply. actually i wanted when i change some it should change in database also. but it can not change in dabase file. for example i load invoice and i chande some item or delete iten when i click save then it is not save data in database file
      thanks
      mac

      Comment

      Working...