VB to acess tables

S

Sean

I am new to VB, am I need help on the structure on how to use VB to run a
query against a table of data. Can someone help and show me the structure?

Also, I have a query that uses two unlinked tables to retrieve data. In the
1st table, the two fields are Item and Cube, cube contains a value like
10,000. The second table has 3 fields , Location, MinCube, & Max Cube. The
query results return the location in the 2nd table based on the cube of the
1st table being between MinCube and MaxCube. The query is:

SELECT DISTINCT SSLot_times_DimCube.Item, SSLot_times_DimCube.Cube,
F10Locations.Location
FROM F10Locations, SSLot_times_DimCube
WHERE (((SSLot_times_DimCube.Cube) Between [mincube] And [maxcube]));

I want to be able to do this in code as well.


Now my query goes a bit further where it not only determines if the cube is
between min and max, but also looks to see if the items 2 longest sides are
<= the locations 2 longest sides and then suggestest a location if it meets
the criteria. If it doesnt meet the criteria, no is given. The statement is:

IIf([SSLot_times_DimCube ].[Cube] Between [mincube] And
[maxcube],IIf([ssLot_Times_DimCube].[L1]<=[F10Locations].[L1],IIf([ssLot_Times_DimCube].[L2]<=[F10Locations].[L2],[F10Locations].[Loc],'No')))

I want to be able to do the query in code but I need it to look at the next
record in the location table if there is not a match with the 1st record
based on the if statement and continue on until a match is found.

I think I can figure this out if I know the structure for how to run a query
with VB and how to do a next statement or Loop until the matching record is
found.

Anyone still reading, thanks for your help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top