Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / May 2008

Tip: Looking for answers? Try searching our database.

create a form from tables to enter data?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ADD NEW DATA IN FORM? - 23 Apr 2008 16:30 GMT
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
Klatuu - 23 Apr 2008 18:40 GMT
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.

Signature

Dave Hargis, Microsoft Access MVP

> 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
[quoted text clipped - 3 lines]
> how do I fix the query so I can add New Records to my form with information
> required in all 6 tables?? help
ADD NEW DATA IN FORM? - 24 Apr 2008 16:50 GMT
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

> 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
[quoted text clipped - 16 lines]
> > how do I fix the query so I can add New Records to my form with information
> > required in all 6 tables?? help
Klatuu - 24 Apr 2008 17:07 GMT
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.
Signature

Dave Hargis, Microsoft Access MVP

> 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
[quoted text clipped - 24 lines]
> > > how do I fix the query so I can add New Records to my form with information
> > > required in all 6 tables?? help
ADD NEW DATA IN FORM? - 06 May 2008 19:55 GMT
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.
[quoted text clipped - 71 lines]
> > > > how do I fix the query so I can add New Records to my form with information
> > > > required in all 6 tables?? help
ADD NEW DATA IN FORM? - 06 May 2008 20:06 GMT
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

> Not a problem.
> There are two ways to do this.
[quoted text clipped - 71 lines]
> > > > how do I fix the query so I can add New Records to my form with information
> > > > required in all 6 tables?? help
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.