PC Review


Reply
Thread Tools Rate Thread

Creating new record in a table

 
 
=?Utf-8?B?TWFSU01BTg==?=
Guest
Posts: n/a
 
      28th May 2007
Table Household fields are Household Of,Last,Sufix(ex."Sr."), First,Middle
when I enter the Last,Sufix,First,Middle I then want Household Of to be
automaticly filled with the "Last Sufix, First Middle" when I exit the table
or when I go to add another new record. If this is posible please give me
the correct expression. Household Of , is my Primary Key as it will be
unique with no duplicates allowed.
--
MARSMAN
 
Reply With Quote
 
 
 
 
Douglas J. Steele
Guest
Posts: n/a
 
      28th May 2007
Are you saying you want to store the data redundantly, once as separate
fields and once combined? That's definitely not recommended.

Instead, keep the fields separate, and create a query with a computed field
that concatenates them together for display purposes. Use the query wherever
you would otherwise have used the table.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"MaRSMAN" <(E-Mail Removed)> wrote in message
news:9FD9CC09-1509-4965-B2FE-(E-Mail Removed)...
> Table Household fields are Household Of,Last,Sufix(ex."Sr."), First,Middle
> when I enter the Last,Sufix,First,Middle I then want Household Of to be
> automaticly filled with the "Last Sufix, First Middle" when I exit the
> table
> or when I go to add another new record. If this is posible please give me
> the correct expression. Household Of , is my Primary Key as it will be
> unique with no duplicates allowed.
> --
> MARSMAN



 
Reply With Quote
 
=?Utf-8?B?TWFSU01BTg==?=
Guest
Posts: n/a
 
      29th May 2007
Yes that is what I want to do. Though this may not be recomended, It does
stop duplicate records from being added to the table andt this field
Household Of becomes my foreign key in many of my other tables. So if there
is the correct expression and syntax for doing this. What would it be.
--
MARSMAN


"Douglas J. Steele" wrote:

> Are you saying you want to store the data redundantly, once as separate
> fields and once combined? That's definitely not recommended.
>
> Instead, keep the fields separate, and create a query with a computed field
> that concatenates them together for display purposes. Use the query wherever
> you would otherwise have used the table.
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no private e-mails, please)
>
>
> "MaRSMAN" <(E-Mail Removed)> wrote in message
> news:9FD9CC09-1509-4965-B2FE-(E-Mail Removed)...
> > Table Household fields are Household Of,Last,Sufix(ex."Sr."), First,Middle
> > when I enter the Last,Sufix,First,Middle I then want Household Of to be
> > automaticly filled with the "Last Sufix, First Middle" when I exit the
> > table
> > or when I go to add another new record. If this is posible please give me
> > the correct expression. Household Of , is my Primary Key as it will be
> > unique with no duplicates allowed.
> > --
> > MARSMAN

>
>
>

 
Reply With Quote
 
John W. Vinson
Guest
Posts: n/a
 
      29th May 2007
On Mon, 28 May 2007 17:52:01 -0700, MaRSMAN <(E-Mail Removed)> wrote:

>Yes that is what I want to do. Though this may not be recomended, It does
>stop duplicate records from being added to the table andt this field
>Household Of becomes my foreign key in many of my other tables. So if there
>is the correct expression and syntax for doing this. What would it be.


Again... YOU REALLY DON'T WANT TO DO THIS.

Names are *NOT* unique. I once worked with Dr. Lawrence David Wise, Ph.D. and
his colleague, Dr. Lawrence David Wise, Ph.D.; I know three people name Fred
Brown.

It will *not* prevent invalid duplicates from being added to the database, if
one gets entered with an abbreviated or missing middle name.

It *will* prevent valid records from being added to the database (unless the
data entry person gets around the restriction as above) if you happen to have
two records for people who happen to share a name.

You can *check* (not prevent) the addition of duplicates by using the Form's
BeforeUpdate event to look up names in the form's recordsource query and
alerting the data entry person of the duplication.


John W. Vinson [MVP]
 
Reply With Quote
 
Joseph Meehan
Guest
Posts: n/a
 
      29th May 2007
MaRSMAN wrote:
> Table Household fields are Household Of,Last,Sufix(ex."Sr."),
> First,Middle when I enter the Last,Sufix,First,Middle I then want
> Household Of to be automaticly filled with the "Last Sufix, First
> Middle" when I exit the table or when I go to add another new
> record. If this is posible please give me the correct expression.
> Household Of , is my Primary Key as it will be unique with no
> duplicates allowed.


No you don't. You just think you do. You don't store redundant data
in a properly designed database. You really don't want to store that
information do you? You want to be able to see it and display it and use it
in reports. So what you do it to use the information already in the table
to display it in a query, report or form.

One reason you don't want to store it is some time down the road you are
going to find you had someone's middle name misspelled. Then you will
correct it, but forget to correct the second field. It will happen.

Remember also that tables are not very good tools to add, display or
edit data. There are lots of reasons. Use forms queries and reports.

--
Joseph Meehan

Dia 's Muire duit



 
Reply With Quote
 
Joseph Meehan
Guest
Posts: n/a
 
      29th May 2007
MaRSMAN wrote:
> Yes that is what I want to do. Though this may not be recomended, It
> does stop duplicate records from being added to the table andt this
> field Household Of becomes my foreign key in many of my other tables.
> So if there is the correct expression and syntax for doing this.
> What would it be.
>


From the Access help file:

In situations where you can't guarantee the uniqueness of any single field,
you may be able to designate two or more fields as the primary key. The most
common situation where this arises is in the table used to relate two other
tables in a many-to-many relationship. For example, an Order Details table
can relate the Orders and Products tables. Its primary key consists of two
fields: OrderID and ProductID. The Order Details table can list many
products and many orders, but each product can only be listed once per
order, so combining the OrderID and ProductID fields produces an appropriate
primary key.

Each product can be listed only once per order.
Another example would be an inventory database that uses a field part number
of two or more fields (part and subpart).
If you are in doubt about whether you can select an appropriate combination
of fields for a multiple-field primary key, you should probably add an
AutoNumber field and designate it as the primary key instead. For example,
combining FirstName and LastName fields to produce a primary key is not a
good choice, since you may eventually encounter duplication in the
combination of these two fields.
In a multiple-field primary key, field order may be important to you. The
fields in a multiple-field primary key are sorted according to their order
in table Design view. You can change the order of the primary key fields in
the Indexes window.

--
Joseph Meehan

Dia 's Muire duit


 
Reply With Quote
 
Tom Wimpernark
Guest
Posts: n/a
 
      30th May 2007
im not sure I agree with this.

in SQL Server you can use calculated fields-- and they're readily available
whenever you want them-- just query the field from the table

sounds to me like you need to go back to architecture school and learn how
to choose a decent database



"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
news:(E-Mail Removed)...
> Are you saying you want to store the data redundantly, once as separate
> fields and once combined? That's definitely not recommended.
>
> Instead, keep the fields separate, and create a query with a computed
> field that concatenates them together for display purposes. Use the query
> wherever you would otherwise have used the table.
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no private e-mails, please)
>
>
> "MaRSMAN" <(E-Mail Removed)> wrote in message
> news:9FD9CC09-1509-4965-B2FE-(E-Mail Removed)...
>> Table Household fields are Household Of,Last,Sufix(ex."Sr."),
>> First,Middle
>> when I enter the Last,Sufix,First,Middle I then want Household Of to be
>> automaticly filled with the "Last Sufix, First Middle" when I exit the
>> table
>> or when I go to add another new record. If this is posible please give
>> me
>> the correct expression. Household Of , is my Primary Key as it will be
>> unique with no duplicates allowed.
>> --
>> MARSMAN

>
>


 
Reply With Quote
 
George Hepworth
Guest
Posts: n/a
 
      30th May 2007
Aaron Kem.pf is posting under a new alias.

"Tom Wimpernark" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> im not sure I agree with this.
>
> in SQL Server you can use calculated fields-- and they're readily
> available whenever you want them-- just query the field from the table
>
> sounds to me like you need to go back to architecture school and learn how
> to choose a decent database
>
>
>
> "Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
> news:(E-Mail Removed)...
>> Are you saying you want to store the data redundantly, once as separate
>> fields and once combined? That's definitely not recommended.
>>
>> Instead, keep the fields separate, and create a query with a computed
>> field that concatenates them together for display purposes. Use the query
>> wherever you would otherwise have used the table.
>>
>> --
>> Doug Steele, Microsoft Access MVP
>> http://I.Am/DougSteele
>> (no private e-mails, please)
>>
>>
>> "MaRSMAN" <(E-Mail Removed)> wrote in message
>> news:9FD9CC09-1509-4965-B2FE-(E-Mail Removed)...
>>> Table Household fields are Household Of,Last,Sufix(ex."Sr."),
>>> First,Middle
>>> when I enter the Last,Sufix,First,Middle I then want Household Of to be
>>> automaticly filled with the "Last Sufix, First Middle" when I exit the
>>> table
>>> or when I go to add another new record. If this is posible please give
>>> me
>>> the correct expression. Household Of , is my Primary Key as it will be
>>> unique with no duplicates allowed.
>>> --
>>> MARSMAN

>>
>>

>



 
Reply With Quote
 
Joseph Meehan
Guest
Posts: n/a
 
      30th May 2007
George Hepworth wrote:
> Aaron Kem.pf is posting under a new alias.


New name same old line. It was very obvious.

--
Joseph Meehan

Dia 's Muire duit



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating Separate form for each record in one Table sreepal Microsoft Access 5 24th Feb 2009 06:44 PM
Creating a record in every table with the job number entered into =?Utf-8?B?RGFuaWVsIExlZXM=?= Microsoft Access 4 28th Jul 2005 04:09 PM
Creating a new record based on another table =?Utf-8?B?UGV0ZXJX?= Microsoft Access VBA Modules 5 11th Jan 2005 07:37 AM
Creating a new record in a table related to 2nd table via 3rd tabl =?Utf-8?B?RGFubnk=?= Microsoft Access Database Table Design 6 30th Dec 2004 06:41 PM
Creating Table to record query results Haji Microsoft Access Forms 3 20th Nov 2003 06:52 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:26 AM.