Select query in visual basic 6
I'm a newbie to this forum and to vb6.I just want to ask some help for my query.
I have a table prodmaster with fields pieceCode,dozenCode,caseCode, proddesc ,inventoryUnit.
example: pieceCode=110 | dozenCode =111 | caseCode=112 | proddesc=apple | inventoryUnit=72
note: inventory unit is constant and all code refers to one item only
I also have a flexgrid and a txtinvno.text
If I put invoice number in the textbox say inv#00152
My flexgrid displays all the products issued in that invoice (inv#00152) and those products may be served in dozen,in piece or in case.
what I want to do now is if my flexgrid(2,1)=rs!pieceCode or flexgrid(2,1)=rs!dozenCode or flexgrid(2,1)=rs!caseCode then flexgrid(2,2)=flexgrid(2,2)/rs!inventoryUnit.
the value of flexgrid(2,1) piececode,dozencode,or casecode of the product issued since we serve some items in piece,dozen, or case.
the value of flexgrid(2,2) is the quantity issued.
can anybody out there help me? what should be my query for this.
I tried Select * from prodmaster where prodCode='"& flexgrid(2,1) &"' or dozenCode='"& flexgrid(2,1) &"' or caseCode='"& flexgrid(2,1) &"' ,
I know it can't be done this way,