Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Apr 2001
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Multiple fileds with one name (Access 97)

    One of my friend says he has a table with a single field name but mutiple fields in that in Access 97.

    for eg:
    Name->FirstName Char
    LastName Char

    is this possible in Access 97 if yes how to do this.

    thanx

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Multiple fileds with one name (Access 97)

    You mean the first and last name in the same field? The field can hold whatever is a legal value for it, whether or not it is a good idea. What is your question?
    Charlotte

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Edmonton, Alberta, Canada
    Posts
    326
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Multiple fileds with one name (Access 97)

    If you mean that you want to sometimes store first name and last name in separate fields (which is a good idea) and other times treat them all as one entity, store them in separate fields and combine them in a report or query when necessary (for instance, you might have something like =[firstname] & " " & [lastname] in the control source of one of the text boxes in a report)

  4. #4
    Star Lounger
    Join Date
    Apr 2001
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Multiple fileds with one name (Access 97)

    Hi,

    I meant whether we could fields such as for eg:
    I want to declare a field CUSTNAME which interm has two fields attached to it as FNAME and LNAME.
    When i want use i shuld be able to use it as CUSTNAME.FNAME or CUSTNAME.LNAME is this possible in ACCESS 97

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Multiple fields with one name (Access 97)

    No. A field is an atomic object in an Access table. Create your FName and LName fields and simply concatenate the two fields when you need to display the entire name. Putting two pieces of data in the same field violates relational database prinicples.

    It is possible to create a custom datatype that would allow you to reference its components like that, but you can only use a custom datatype in code, not in a table. If you tried to read the entire custname field into a custom datatype, you would have to determine how to parse the name into the components, which is way more work than just storing it properly in the first place.
    Charlotte

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •