Greetings all,
I have a database with two tables: docs and edocs. For each record in
docs there can be zero to unlimited records in edocs. Both tables have
an integer primary key named index. The edocs table also has an
integer field docs_index whose value will be the corresponding docs
index.
Here's a rudimentary layout:
docs
index name ..other fields...
1 record1 .....
2 record2 .....
3 record3 .....
4 record4 .....
edocs
index docs_index filename ...other fields...
1 1 test.txt .......
2 1 test2.txt .......
3 1 test3.txt .......
4 2 test4.txt .......
5 2 test5.txt .......
6 4 test6.txt .......
OK. Simple.
Now I want to create a form the includes all the necessary fields from
docs, and a blank datasheet for any records that will need to go into
edocs. I want a blank datasheet because I have no way of knowing if
there will be zero, one, two or fifteen records in edocs associated with
the new record in docs.The only way I found to put a blank datasheet
into a form was to create a query that will always return no rows, i.e.
select * from docs where index < 0 (index is always positive)
Is there a better way to do this?
Then once the user fills in the form, how would I insert the data into
edocs? Is there a foreach type of command?
Please excuse my ignorance - I know exactly how I would do this with a
SQL database with a PHP-based front end, but I am not that schooled in
Access/VB. Pointing me to a tutorial on the Web for something like
this would be great as well.
I will be happy to provide more info if needed. Thanks in advance!!
Pete