If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Visual Basic > [Ask] lookup in VB

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-19-11, 23:27
agasha agasha is offline
Registered User
 
Join Date: Apr 2011
Posts: 1
Question [Ask] lookup in VB

Dear Master,

I have Access DB with 2 table, AWBILLand Compare
and some field that related to this prolem is [awbill][picklist], [awbill][No Awb], [Compare][issNo] and [compare][awbno].

this is the condition
[awbill][picklist], [awbill][No Awb] is the array. if [Compare][issNo] same record with [awbill][picklist], [compare][awbno] = [awbill][No Awb]

the condition is the same as vlookup on excel, can u give me advice how can i create that lookup in VB6
Attached Thumbnails
[Ask] lookup in VB-untitled.jpg  
Reply With Quote
  #2 (permalink)  
Old 04-20-11, 03:59
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,262
JET uses SQL to manipulate data, usually seen in Access as queeries
so what (I think) you are looking for is a query which links the two items

the query will take the form of
SELECT a, list, of, columns, from, your, tables FROM atable
JOIN btable ON btable.somecolumn = atable.anothercolumn
WHERE acondition=true
ORDER BY some, columns

so it comes down as to how you know the two tabels are interelated
is picklist the same entity as issno?
for this exercise lets assume they are

SELECT a, list, of, columns, from, your, tables FROM compare
JOIN awbill on awbill.picklist = compare.issno
..you don't have to include a WHERE clause, but if you wanted to you could
WHERE comapre.yrmth = 1103
..you don't have to include an ORDER BY clause, but often they are used to make the data easier to read
ORDER BY trxdate

incidentally yrmth is a seriusly kludgy column, especailly as ont he face of it its derived from the transaction date
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On