473,661 Members | 2,501 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3104
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******@NOSPA M.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
10181
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 to enter one form for each sub project on each tab page. ...=>
3
3560
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 the field name. Is there a way to retain this nomenclature and yet have the view display the field name (or anyname i want for that matter)? Thanks --
4
1841
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 record) always appears as the end of the form (i.e. the bottom), whereas it would be very helpful if it appeared at the beginning (the top of the form). Can anyone suggest a way to make this happen? Regards
6
3068
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 record such as: part number 202354-001 location C1-01
3
3716
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 dotted line around them so the receptionist can easily cut them out. The report is setup with columns so that 6 columns fit across a page. 12 records per column, 6 columns across a page, each record has a dotted line around the box. The...
1
1891
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 white area! The subform is an actual form and not a datasheet. Can anyone tell me the reasoning behind this and how to fix it. Thanks OS: Vista Access Version: 2007
1
1190
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 been done about 90%, but I would like to make a few edits. I need to add new fields. The help files says:
2
3147
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 me Datasheet view. Dialog mode won't give me Datasheet view I could make Form01 Restore size and expand it to fill the Window in Restore size (maybe DoCmd.MoveSize Right, Down, Width, Height) - I don't want this.
3
2997
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 subform, allowing the user to type certain fields but complete other fields via code in the beforeinsert event as follows Private Sub Form_BeforeInsert(Cancel As Integer) Me.Kitchen = Me.Parent.Kitchen(2) Me.lookupRoute = Me.Parent.Kitchen(1) ...
0
8432
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8855
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8758
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8545
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6185
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5653
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4179
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2762
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1743
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.