Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003
    Posts
    29

    Unanswered: Default value using an Autonumber field

    Hello,

    This sounds like it should be a simple task, however, I am experiencing difficulties accomplishing it. What I need to do is take the autonumber field of a table and incompass its value in to another field in the same table. For instance I have an autonumber field named [Record] and I want another field named [strRecord] to be equal to a text string combined with that autonumber - example AB1234.

    I am trying to do this using the default value with limited or no success. The entering of the field must be on table level and can not be in a form or query. That would not be a problem. However, I am perplexed. This sounds like it should be a piece of cake to accomplish.

    Any ideas???

    Thanks

  2. #2
    Join Date
    Sep 2002
    Location
    South Wales
    Posts
    580

    Red face Question?

    Why do you need to store this in the table when it can automatically be generated from a query?

    SAY

    TABLE
    tblJobDetails
    JobDetailsPK = 123456
    JobNumber = ABC

    QUERY
    SELECT [JobDetailsPK] & [JobNumber] AS BothFields
    FROM tblJobdetails
    WITH OWNERACCESS OPTION;

    Can you explain why you want to store it in the table?
    Windows Server 2003-8 / Terminal Services / SQL 2000 / Access 2003 / Office 2003-7 / Exchange 2003-7 / Blackberry Enterprise Server / AutoCAD / Lambert And Butler / Red Bull

  3. #3
    Join Date
    Sep 2003
    Posts
    29

    Re: Question?

    This field with the combination of Text and Autonumber is going to be used in a financial schedule. Essentially, this field will be used to tie in a large number of transactions to one source company. However, this is where it gets a little wierd. There are about 5 other tables that will be using the schedule as well. In other words, I really have no unique identifiers which are resident to any one record.

    What I am going to do is create a new field to store the unique ID text(Which Designates the origination table) and the autonumber value as the data comes in to the new table. I am going to use a switch to designate whether the new unique ID has already been created.

    I didn't mention that the destination table of all the other tables information is cleared upon closing the form that uses it. There are a lot of varying details I have obviously left out about this application that create this situation. This seems to be the current best solution.


    I appreciate your help.

    Thanks,

    Abboabbo

    Originally posted by garethdart
    Why do you need to store this in the table when it can automatically be generated from a query?

    SAY

    TABLE
    tblJobDetails
    JobDetailsPK = 123456
    JobNumber = ABC

    QUERY
    SELECT [JobDetailsPK] & [JobNumber] AS BothFields
    FROM tblJobdetails
    WITH OWNERACCESS OPTION;

    Can you explain why you want to store it in the table?

Posting Permissions

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