Results 1 to 4 of 4
  1. #1
    Cfish3r is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2012
    Posts
    4

    Filling data in to one table from another, using some sort of lookup?

    Hi all,

    I am going to be terribly rude and join simply to ask a question.
    My will probably require a fair bit of Access usage, so hopefully I will quickly get skilled in it and perhaps may be able to help some others in the future.

    I have an A level in computing, so I do understand a fair amount of the concepts, but I just need a bit of a pointer as to how to achieve the following.

    My Data:

    Table: XeroxRequest
    - ID (auto-number)
    - Usage Function (Text) *This contains only one of three values.
    - Serial Number (text)
    - Reading (Number) *This is a blank field, and is the field I am trying to fill.
    - Reading Date (Date) *This is automatically filled in with the current date when importing data.
    - Counter ID (text)
    - Contract Number (text)
    - Last Valid Reading (Number) *This is for a future validation step that I am not worrying about yet.


    Table: OurData
    - ID (Auto-number)
    - Serial
    - Meter (text)
    - Reading (number)



    Queries

    1. First, the data in the OurData table needs to be formatted so that it matches the data in the other table. So far, I have a query that does the following.

    Query: OurDataformatted:
    - TrimSerial: Trim(Left([Serial],10))
    *This is to strip unwanted characters from the serial so that it can match the 'serial' in the XeroxRequest table.

    - Meter2match: IIf([Meter]="Colour","ZCOT",IIf([Meter]="MONO","ZBWT",IIf([Meter]="Black & White","ZBWT")))
    * This replaces the possible entries in this field, with the relevant text so that it matches the 'usagefunction' in the XeroxRequest table.

    - Reading.
    *This is left as is.


    What I need:

    1. For every serial number in the XeroxRequest table, I need to search for an entry in the Query (or table) where the serial numbers match.
    2. The UsageFunction also needs to match the 'Meter2match' in the query.

    Further Info:
    - The XeroxRequest table can contain multiple instances of one serial.
    BUT it will only contain one combination of serial and Meter.

    For example, it may contain:

    --Serial---------useageFunction
    - FBT1234567 ---- ZCOT
    - FBT1234567 ---- ZBWT
    - FBT7418526-----ZBWT
    - FBT3698524-----ZCOT


    - FBT3698524-----ZBWT


    - The OurData table may also do the same. Hence the challenge is to match up the readings using the serial and usage function.















    .....
    What would be the best way to achieve this?
    The person who can help me get this working will receive a drink on me (or something)!


    MUCH appreciated,
    Cameron Fisher.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    If this thread is actually solved, would you care to share your solution with others that read this Forum?

  3. #3
    Cfish3r is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2012
    Posts
    4
    Yes of course!
    I must of been thick.

    I double checked that all my serial number fields were correctly trimmed.

    Then created a query with the following parameters:
    Click image for larger version. 

Name:	screenshot.png 
Views:	10 
Size:	28.4 KB 
ID:	9513

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Thank you for sharing!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 04-27-2012, 10:21 AM
  2. Replies: 6
    Last Post: 12-30-2011, 09:51 AM
  3. Table lookup, sort of
    By avarusbrightfyre in forum Programming
    Replies: 1
    Last Post: 08-30-2011, 02:20 PM
  4. filling table
    By janco in forum Queries
    Replies: 2
    Last Post: 07-24-2011, 09:16 AM
  5. Using lookup data for table 1 mutible times in table 2
    By mbjazz in forum Database Design
    Replies: 5
    Last Post: 04-26-2011, 01:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums