p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Stephens' Visual Basic Programming 24-Hour Trainer (http://p2p.wrox.com/forumdisplay.php?f=621)
-   -   Select query in visual basic 6 (http://p2p.wrox.com/showthread.php?t=93351)

desireslearning July 30th, 2014 03:37 AM

Select query in visual basic 6
 
Hi guys,

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,

help please.


All times are GMT -4. The time now is 08:27 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.