vba for access

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table with entries for the days horse racing, each race has an
identity number. I wish to extract one race at a time to use with other
lookup tables.
In dbase111 it's easy, I set the record pointer and copy wanted number of
runners to new file. This will be my first program for access 2002 so any
advice needs to be very basic.
 
I have a table with entries for the days horse racing, each race has an
identity number. I wish to extract one race at a time to use with other
lookup tables.

I'm not really sure what you mean here. If your table is like this:

Entries(RaceNumber, HorseNumber, Handicap, FeePaid...)

then you can make a query like

SELECT ALL RaceNumber, COUNT(HorseNumber)
FROM Entries
GROUP BY RaceNumber
ORDER BY RaceNumber

or, if you only want a list of valid RaceNumbers, it's even easier

SELECT DISTINCT RaceNumber
FROM Entries
ORDER BY RaceNumber

I don't really know how this helps with "other lookup tables" though?

HTH


Tim F
 
To 'set the record pointer' in VBA, use Seek, FindFirst/FindNext, or
MoveFirst/MoveNext.

In Access, you also have the option of using SQL and/or stored queries
to perform operations like this, instead of using code like dbIII.

When you want to use data from one table with data from other tables,
it is normal to create a query to do that part of the operation.

You can run or use a query from VBA or from a macro.

(david)
 
Thanks for your quick response, your code will achieve what I want.

again much obliged

maurice.
 
Back
Top