Query a Large Database - Form & Sub form

S

Sameer

Hi All,
I have a Database with five tables.

1) Timestamps - fields-> ID, Timestamp(Date/Time) ; 83,000 Records
2) Names - fields-> ID, Name ; 1000 records
3) Cars - fields-> ID, Name ; 36000 records
4) Colors - fields-> ID, Name ; 1000 records

5) Users -> fields -> ID, TimeStampID, NameID, CarID, ColorID, Price ;
6.3 million records

I would like to create a form which has a sub form. On the main form,
i have two text boxes where they enter a "from date" and a "to date".
There is a command button, and for each set of dates, the user
chooses,i would like to display the following table in the subform :

[Timestamp Name Car Color Price]

My first query was
"Select TimeStamps.Timestamp, Names.Name as Name,Colors.Name as Color,
Cars.Name as Car From Timestamps,Names,Colors,Cars Where
Users.TimestampID=Timestamps.ID And Users.CarID = Cars.ID and
Users.ColorID = Colors.ID ORDER BY Timestamp"

I put this in the subform's record souce.

Then everytime i click on the command button, i would filter the
record source in the subform by

Me.Filter = "Timestamp >= #" & strFromTime & "# AND Timestamp<=#" &
strToTime & "#"
Me.Filteron = true

and i would get the desired results. This is good for small database,
but for my database, my users table consisting of 8.3 million records,
this takes a long long time to execute. Is there a more effiecient way
to do this?. Also, is Ms Access the best database to store large
chunks of data. I mean i have some dbs, that are as large as 8 Million
records. They are normalized so i have mainly indices in the huge
table.

I would appreciate any comments on this topic.

Thanking you in advance,
Sameer
 

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