Page 2 of 2 FirstFirst 12
Results 16 to 24 of 24
  1. #16
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521

    Happy to help Rick! Not sure what you're asking. An autonumber field is certainly common as the primary key, but not mandatory. Why do you think you need it vs what exists now?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  2. #17
    kamathmanoj is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    May 2019
    Posts
    41
    Hi Paul,

    The existing table has one record that is manipulated for incoming and production as follows:

    First entry when the material for the product is received - all fields are populated.
    Second & subsequent entries when the material is checked out for the production, employee ID and number of products made, weight of material remaining is recorded. (These fields are blank when material is received in the first entry.)

    (Now if it is a partial use of the material from the first check out, the material is checked back in for subsequent use and the cycle repeats until the order is complete or the material is exhausted)

    So several ins and outs of the material form only one entry but the table should ideally record each transaction separately, isnt it? Else we loose track of what happened in each check-out. Please let me know if I have to rephrase anything because I typed stupidly.

    Regards,
    Rick

  3. #18
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I won't pretend to understand your business, but as a rule yes, I would record each transaction separately.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #19
    kamathmanoj is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    May 2019
    Posts
    41
    Hey Paul,

    No worries - you know so much that we are in agreement on this anyways. I have let the CIO know that we will need to restructure the table and that may alter all its dependencies a bit. Turns out that he agrees its a long term project.

    Here is a different question on the same type of form. I am trying to take the data from several fields on the form and concatenate them into one field so that I can generate a data matrix code. Do you think it can be done?

    If yes, can you let me know how to have the code field pick all the values I need from the form into its own unbound field?

    Example:
    Field 1 - Supplier Name
    Field 2 - Coil Tag Number
    Field 3 - Width
    Field 4 - Thickness
    Field 5 - Part Number
    Field 6 - Theoretical Yield
    Field 7 - Supplier Name+Coil Tag Number+Width+Thickness+Part Number+Theoretical Yield (To be able to generate a data matrix code.

    Regards,
    Rick

  5. #20
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    In a query you can concatenate them. In design view:

    DataMatrix: Field1 & Field2 & Field3

    You could also try using a calculated field in the table, though I haven't used one myself.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #21
    kamathmanoj is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    May 2019
    Posts
    41
    Hi Paul,

    That worked. My next question is a little more complicated.

    I have a different select query that is feeding a different form.

    I need to scan a bar code that fills in a text box for product ID with numbers. How do I check if the scanned code (in number format) matches any of the product ID's in the Product ID field of the query. I know it would be easier if it was a table - then I could use DLOOKUP but it doesnt want to work with a query. Can you help?

    Regards,
    Rick

  7. #22
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    DLookup() should work with a query; are you getting an error or something? It would have to be a saved query, not SQL. The alternative is opening a recordset on the query.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #23
    kamathmanoj is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    May 2019
    Posts
    41
    aha! so I have to create an object to store the contents of the query in order to be able to use dlookup()

  9. #24
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Well, DLookup() won't work like DLookup("FieldName", "SELECT...", "Criteria"). The table/query argument has to be a table or saved query.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Adding columns based on row criteria
    By Coryjacques in forum Queries
    Replies: 2
    Last Post: 11-09-2018, 12:23 PM
  2. Replies: 1
    Last Post: 01-19-2017, 10:13 AM
  3. Replies: 3
    Last Post: 12-01-2015, 12:20 PM
  4. Adding Columns in a Query
    By racefan91 in forum Queries
    Replies: 5
    Last Post: 10-01-2013, 02:34 PM
  5. Replies: 1
    Last Post: 08-28-2013, 07:40 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