By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,498 Members | 835 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,498 IT Pros & Developers. It's quick & easy.

Adding blank datasheet to a form

P: n/a
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
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Mal
This looks like a classic example of when to use a Parent/Child
relationship in a simple Form/Subform

You will only get 1 empty row in the subform...but each time you add a
child record, you get another blank row below it (so long as Allow
Additions is set to true)

seach help for Subforms and Parent/Child - it should do all you
specified....a lot easier than worrying about for/each loops or
anything like that

Peter Kleiner <kl******@NOSPAM.smbmicro.com> wrote in message news:<40***************@NOSPAM.smbmicro.com>...
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

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.