Being relatively new to VB (Win95, VB5) I am trying to set up a
generic routine to display a table, along with a param-query that
synchronizes with the key-field from the table. Here's the situation:
An MDB with:
- TableOne and TableMany
- QueryMany, set up as a param-query (Select Field2, Field3 from
TableMany where [TableOne.ForeignKey] = [TableMany.Key]
A form with:
- two DBGrids, DBGridOne and DBGridMany
- two data-controls, dtaOne and dtaMany
At startup the grids are filled from the data-controls, synchronizing
DBGridMany with DBGridOne.
I did manage to set this up with a hard-coded path to the MDB, but the
trouble starts when I read the directorypath from the registry.
First I set dtaOne.DatabaseName to point to the hard-coded dir, then
RecordSource to TableOne. The same for DBGridMany.
Then I remove the dtaOne.DatabaseName and read the databasename from
the registry. At that point I bumped into the fact that
dtaOne.RecordSource is available at design-time only (why this is done
baffles me anyway :-).
Who can point me in the right direction with this problem?
Thanks in advance,
Henk