473,322 Members | 1,241 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Adding blank datasheet to a form

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
1 3081
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Dee | last post by:
I have a form which contains basics of a customer's order from table . I placed a tab control on this form which is still empty. I'm trying to design a project management database and would like...
3
by: Kent Eilers | last post by:
I want to follow naming conventions for my controls - i usually prefix combo boxes with "cbo". When a form is in datasheet view however i do not want the user to see the 'cbo' prefix in front of...
4
by: John Baker | last post by:
Hi: I have a query which supports a form. Te form is used to edit, update and change records in the table the query is based on. It all works fine EXCEPT that the "New" record (blank updatable...
6
by: 6thirty | last post by:
Hi, I've created a stocktaking database using Access XP. This is indexed by two fields - part number and shelf location. I am currently inputting all the data via a form. When I have entered a...
3
by: grlgeek | last post by:
I have a report for creating the switchboard labels for our phone system receptionist switchboard. The template has 12 records per column. I setup a report that will create the labels and put a...
1
by: wideasleep | last post by:
Hello All, I recently added a new field on my subform and made a relationship to it with the ID fields. When I did this the subform went blank. I mean there were no fields or anything! It's just a...
1
by: tmbowman25 | last post by:
Hi I'm trying to create a database for my companys inventory and I have almost no experience on Access nor the time to get the training. I'm using the inventory template so the work has already...
2
by: Alan Forsyth | last post by:
That rather long subject says it. In Access97 running on XP - I want to display a Maximized size Form01, then open a Restore size Datasheet View Form02 on top of the first Form. PopUp won't give...
3
by: pzh20 | last post by:
I have an unbound form/subform where I populate a combo box on the main form, and using the onchange event, display fields from a table in a datasheet subform. I want to add a new record via the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.