A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

create a form from tables to enter data?



 
 
Thread Tools Display Modes
  #1  
Old April 23rd, 2008, 04:30 PM posted to microsoft.public.access.forms
ADD NEW DATA IN FORM?
external usenet poster
 
Posts: 1
Default create a form from tables to enter data?

I have a total of 6 tables. they all have a Item# as a PK. I have tried to
create a FORM to enter all NEW data but no luck. I create a query from all
the table, but could not enter anything in the form. my form is not even
blank, is has all the data from the query. HELP, I have tried everything and
I need a form that will be able to accept new data.
how do I fix the query so I can add New Records to my form with information
required in all 6 tables?? help
  #2  
Old April 23rd, 2008, 06:40 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default create a form from tables to enter data?

A form can have only one record source. It can be either a table or a query.
The query can be built on multiple tables or queries, but in many cases, you
end up creating an uneditable recordset. That is what you have done.

My suggestion would be to use a form with 5 subforms. Use which ever table
is the primary table for the form and assign a table to each of the subforms.

To keep them in sync, you use the Link Master Fields(s) and Link Child
Fields(s) properties of the subform control. In the Master, you put the name
of the field in the main form's recordset that contains the item number. In
the Child you put the name of the field in the subform's recordset that
contains the item number.

--
Dave Hargis, Microsoft Access MVP


"ADD NEW DATA IN FORM?" wrote:

I have a total of 6 tables. they all have a Item# as a PK. I have tried to
create a FORM to enter all NEW data but no luck. I create a query from all
the table, but could not enter anything in the form. my form is not even
blank, is has all the data from the query. HELP, I have tried everything and
I need a form that will be able to accept new data.
how do I fix the query so I can add New Records to my form with information
required in all 6 tables?? help

  #3  
Old April 24th, 2008, 04:50 PM posted to microsoft.public.access.forms
ADD NEW DATA IN FORM?[_2_]
external usenet poster
 
Posts: 7
Default create a form from tables to enter data?

I got the first part I think. So I should create one Main form, and then 5
other subforms? So when I am ready to add a new record I start with the main
Form then add the same information to the Subforms?? correct?
I am not sure I know where or how to find and use "the Link Master Field" ;
would I find that in the "propreties"?? I have not created a Subform yet and
I am not sure I know how.
It seems like I need ur help again...thanks

"Klatuu" wrote:

A form can have only one record source. It can be either a table or a query.
The query can be built on multiple tables or queries, but in many cases, you
end up creating an uneditable recordset. That is what you have done.

My suggestion would be to use a form with 5 subforms. Use which ever table
is the primary table for the form and assign a table to each of the subforms.

To keep them in sync, you use the Link Master Fields(s) and Link Child
Fields(s) properties of the subform control. In the Master, you put the name
of the field in the main form's recordset that contains the item number. In
the Child you put the name of the field in the subform's recordset that
contains the item number.

--
Dave Hargis, Microsoft Access MVP


"ADD NEW DATA IN FORM?" wrote:

I have a total of 6 tables. they all have a Item# as a PK. I have tried to
create a FORM to enter all NEW data but no luck. I create a query from all
the table, but could not enter anything in the form. my form is not even
blank, is has all the data from the query. HELP, I have tried everything and
I need a form that will be able to accept new data.
how do I fix the query so I can add New Records to my form with information
required in all 6 tables?? help

  #4  
Old April 24th, 2008, 05:07 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default create a form from tables to enter data?

Not a problem.
There are two ways to do this.
One is to create a subform control on the main form as size it so it will
show the data you need. The wizard will then allow you to create the form
that will be shown in the subform control.
I prefer to create the form that I will use as the subform first.
Then I create the subform control on the form.
To identify the name of the subform that will show in the subform control is
to enter the name of the form in the Control Source property.

The Link Master Field(s) and Link Child Fields(s) are also properties of the
subform control. These are important and make life much easier.
In the Link Master Field(s) property you enter the field name(s) of the
field(s) in the main form's record source that are the primary key field(s)
of the main form's underlying table. It is usually one field, but can be
multiple fields.

The child tables that relate to the main table need to have a foreign key
field in addition to their own primary key field. That is a field that
carries the value of the primary key field that relates the record to a
record in the parent table. This is the field name you use in the Link Child
Field(s) property.

If you use the Link Master/Child properties, when you create a new record in
a subform, it will autmatically populate the subform's recordset with it's
primary key (if you use an autonumber primary key for the child table) and
will (regardless of whether the child table's primary key is an autonumber)
populate the child table's foreign key field with the primary key value of
the record in the main form. All you need then is to enter the additional
data.

One other hint. When you create a subform control and use the wizard to
create the form to use, it will give the subform control and the subform form
the same name. It is better to give them different names to avoid any
confusion. I use what is sometimes know as Hungarian Notation. That is, a
predefined naming convention where you prefix each object name with specific
value to identify the type of object. For example, All forms start with frm,
forms being used as subforms can do the same or I use subf. Controls on
forms are like txt for Text Box, chk for Check Box, cbo for Combo Box, lst
for List Box, and for a subform control I use sub.

I know this is all probably confusing, but once you do it, the next time
will be easy. Feel free to post back with questions as you move along with
this.

Good Luck.
--
Dave Hargis, Microsoft Access MVP


"ADD NEW DATA IN FORM?" wrote:

I got the first part I think. So I should create one Main form, and then 5
other subforms? So when I am ready to add a new record I start with the main
Form then add the same information to the Subforms?? correct?
I am not sure I know where or how to find and use "the Link Master Field" ;
would I find that in the "propreties"?? I have not created a Subform yet and
I am not sure I know how.
It seems like I need ur help again...thanks

"Klatuu" wrote:

A form can have only one record source. It can be either a table or a query.
The query can be built on multiple tables or queries, but in many cases, you
end up creating an uneditable recordset. That is what you have done.

My suggestion would be to use a form with 5 subforms. Use which ever table
is the primary table for the form and assign a table to each of the subforms.

To keep them in sync, you use the Link Master Fields(s) and Link Child
Fields(s) properties of the subform control. In the Master, you put the name
of the field in the main form's recordset that contains the item number. In
the Child you put the name of the field in the subform's recordset that
contains the item number.

--
Dave Hargis, Microsoft Access MVP


"ADD NEW DATA IN FORM?" wrote:

I have a total of 6 tables. they all have a Item# as a PK. I have tried to
create a FORM to enter all NEW data but no luck. I create a query from all
the table, but could not enter anything in the form. my form is not even
blank, is has all the data from the query. HELP, I have tried everything and
I need a form that will be able to accept new data.
how do I fix the query so I can add New Records to my form with information
required in all 6 tables?? help

  #5  
Old May 6th, 2008, 07:55 PM posted to microsoft.public.access.forms
ADD NEW DATA IN FORM?[_2_]
external usenet poster
 
Posts: 7
Default create a form from tables to enter data?

Hello
I thank you so much for your help. I got what you said and I had done
exactly that. Everything is working well. thanks



Not a problem.
There are two ways to do this.
One is to create a subform control on the main form as size it so it will
show the data you need. The wizard will then allow you to create the form
that will be shown in the subform control.
I prefer to create the form that I will use as the subform first.
Then I create the subform control on the form.
To identify the name of the subform that will show in the subform control is
to enter the name of the form in the Control Source property.

The Link Master Field(s) and Link Child Fields(s) are also properties of the
subform control. These are important and make life much easier.
In the Link Master Field(s) property you enter the field name(s) of the
field(s) in the main form's record source that are the primary key field(s)
of the main form's underlying table. It is usually one field, but can be
multiple fields.

The child tables that relate to the main table need to have a foreign key
field in addition to their own primary key field. That is a field that
carries the value of the primary key field that relates the record to a
record in the parent table. This is the field name you use in the Link Child
Field(s) property.

If you use the Link Master/Child properties, when you create a new record in
a subform, it will autmatically populate the subform's recordset with it's
primary key (if you use an autonumber primary key for the child table) and
will (regardless of whether the child table's primary key is an autonumber)
populate the child table's foreign key field with the primary key value of
the record in the main form. All you need then is to enter the additional
data.

One other hint. When you create a subform control and use the wizard to
create the form to use, it will give the subform control and the subform form
the same name. It is better to give them different names to avoid any
confusion. I use what is sometimes know as Hungarian Notation. That is, a
predefined naming convention where you prefix each object name with specific
value to identify the type of object. For example, All forms start with frm,
forms being used as subforms can do the same or I use subf. Controls on
forms are like txt for Text Box, chk for Check Box, cbo for Combo Box, lst
for List Box, and for a subform control I use sub.

I know this is all probably confusing, but once you do it, the next time
will be easy. Feel free to post back with questions as you move along with
this.

Good Luck.
--
Dave Hargis, Microsoft Access MVP


"ADD NEW DATA IN FORM?" wrote:

I got the first part I think. So I should create one Main form, and then 5
other subforms? So when I am ready to add a new record I start with the main
Form then add the same information to the Subforms?? correct?
I am not sure I know where or how to find and use "the Link Master Field" ;
would I find that in the "propreties"?? I have not created a Subform yet and
I am not sure I know how.
It seems like I need ur help again...thanks

"Klatuu" wrote:

A form can have only one record source. It can be either a table or a query.
The query can be built on multiple tables or queries, but in many cases, you
end up creating an uneditable recordset. That is what you have done.

My suggestion would be to use a form with 5 subforms. Use which ever table
is the primary table for the form and assign a table to each of the subforms.

To keep them in sync, you use the Link Master Fields(s) and Link Child
Fields(s) properties of the subform control. In the Master, you put the name
of the field in the main form's recordset that contains the item number. In
the Child you put the name of the field in the subform's recordset that
contains the item number.

--
Dave Hargis, Microsoft Access MVP


"ADD NEW DATA IN FORM?" wrote:

I have a total of 6 tables. they all have a Item# as a PK. I have tried to
create a FORM to enter all NEW data but no luck. I create a query from all
the table, but could not enter anything in the form. my form is not even
blank, is has all the data from the query. HELP, I have tried everything and
I need a form that will be able to accept new data.
how do I fix the query so I can add New Records to my form with information
required in all 6 tables?? help

  #6  
Old May 6th, 2008, 08:06 PM posted to microsoft.public.access.forms
ADD NEW DATA IN FORM?[_2_]
external usenet poster
 
Posts: 7
Default create a form from tables to enter data?

Hello this is my next problem...Can you help me with these IFF STATEMENTS

Keep in mind that I have most of the fields. the only thing I don't have
which should be include in the statement are the dates. I have the RACC
field, serving size, sodium, cholesterol etc... I just don't know how to do
this IIf statement

SODIUM: Before January 1, 1998: =480 mg per RACC and per Serving, EXCEPT if
RACC =30g-- =480 mg per 50 g of food; after January 1, 1998: this level
reduces to =360 mg

CHOLESTEROL: =60 mg per RACC, per serving, and if RACC =30g per 50g of food

"Klatuu" wrote:

Not a problem.
There are two ways to do this.
One is to create a subform control on the main form as size it so it will
show the data you need. The wizard will then allow you to create the form
that will be shown in the subform control.
I prefer to create the form that I will use as the subform first.
Then I create the subform control on the form.
To identify the name of the subform that will show in the subform control is
to enter the name of the form in the Control Source property.

The Link Master Field(s) and Link Child Fields(s) are also properties of the
subform control. These are important and make life much easier.
In the Link Master Field(s) property you enter the field name(s) of the
field(s) in the main form's record source that are the primary key field(s)
of the main form's underlying table. It is usually one field, but can be
multiple fields.

The child tables that relate to the main table need to have a foreign key
field in addition to their own primary key field. That is a field that
carries the value of the primary key field that relates the record to a
record in the parent table. This is the field name you use in the Link Child
Field(s) property.

If you use the Link Master/Child properties, when you create a new record in
a subform, it will autmatically populate the subform's recordset with it's
primary key (if you use an autonumber primary key for the child table) and
will (regardless of whether the child table's primary key is an autonumber)
populate the child table's foreign key field with the primary key value of
the record in the main form. All you need then is to enter the additional
data.

One other hint. When you create a subform control and use the wizard to
create the form to use, it will give the subform control and the subform form
the same name. It is better to give them different names to avoid any
confusion. I use what is sometimes know as Hungarian Notation. That is, a
predefined naming convention where you prefix each object name with specific
value to identify the type of object. For example, All forms start with frm,
forms being used as subforms can do the same or I use subf. Controls on
forms are like txt for Text Box, chk for Check Box, cbo for Combo Box, lst
for List Box, and for a subform control I use sub.

I know this is all probably confusing, but once you do it, the next time
will be easy. Feel free to post back with questions as you move along with
this.

Good Luck.
--
Dave Hargis, Microsoft Access MVP


"ADD NEW DATA IN FORM?" wrote:

I got the first part I think. So I should create one Main form, and then 5
other subforms? So when I am ready to add a new record I start with the main
Form then add the same information to the Subforms?? correct?
I am not sure I know where or how to find and use "the Link Master Field" ;
would I find that in the "propreties"?? I have not created a Subform yet and
I am not sure I know how.
It seems like I need ur help again...thanks

"Klatuu" wrote:

A form can have only one record source. It can be either a table or a query.
The query can be built on multiple tables or queries, but in many cases, you
end up creating an uneditable recordset. That is what you have done.

My suggestion would be to use a form with 5 subforms. Use which ever table
is the primary table for the form and assign a table to each of the subforms.

To keep them in sync, you use the Link Master Fields(s) and Link Child
Fields(s) properties of the subform control. In the Master, you put the name
of the field in the main form's recordset that contains the item number. In
the Child you put the name of the field in the subform's recordset that
contains the item number.

--
Dave Hargis, Microsoft Access MVP


"ADD NEW DATA IN FORM?" wrote:

I have a total of 6 tables. they all have a Item# as a PK. I have tried to
create a FORM to enter all NEW data but no luck. I create a query from all
the table, but could not enter anything in the form. my form is not even
blank, is has all the data from the query. HELP, I have tried everything and
I need a form that will be able to accept new data.
how do I fix the query so I can add New Records to my form with information
required in all 6 tables?? help

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:06 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.