Results 1 to 6 of 6

Thread: Inserting lookup data in a field of a table

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2008
    Posts
    144

    Inserting lookup data in a field of a table

    Not using forms or reports or data views here is what I need to do.

    Lookup a value in a table based on two existing values of a record in the record to be updated.

    Something like this:

    Field1 - Field2 - Field3

    Field1 is the result of a lookup based on Field2 and Field3. Can be Dlookup or SQL. User selects values for Field1 and Field2 and the result of the lookup is posted to Field1

    I have not been able to figure out how to embed this in the definition of the table.

  2. #2
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: Inserting lookup data in a field of a table

    What database?
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Dec 2008
    Posts
    144

    Re: Inserting lookup data in a field of a table

    Oops MS Access. I assumed all questions here were about Access..sorry.

  4. #4
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: Inserting lookup data in a field of a table

    You could base the field1 value on a macro (if in Access) that takes fields 2 and 3 performs and manipulation on it and save that in field1.
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Dec 2008
    Posts
    144

    Re: Inserting lookup data in a field of a table

    Do you have to run the macro separately or will it auto run somehow.

  6. #6
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: Inserting lookup data in a field of a table

    You will need to set the fields attributes to call the macro. It has been a long time since I had to do any of this in Access.
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

Posting Permissions

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



Click Here to Expand Forum to Full Width