Results 1 to 3 of 3
  1. #1
    ASW is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2012
    Posts
    1

    Default Values In Form

    Hi,

    I have two tables: Stock take Records and Cost of Materials. I have created a form based on the Stock Take Records table which has the below fields:

    Part no
    Item Description
    Material Cost
    Sub Con Cost
    Labour Cost
    (And others fields for stock taking)



    (The Cost of Materials table also has the above fields).

    I have changed the Part No to be a drop down selection that is looking at the Cost of Materials table. When I select a part number from this list, I would like the default values for the above to be populated with the values held in the cost of materials table. The numbers held in Material Cost, Sub Con Cost and Labour Cost need to be able to be changed for each record depending on how far along assembly is which is why I am trying to set them up as default values.

    I have tried setting default values and using a DLookUp but can't seem to get it to work. Wasn't sure if i'm doing something wrong or do I need to do this by using VBA?

    Any suggestions would be greatfully received!

  2. #2
    hertfordkc is offline 18 year novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    481

    IMHO, using duplicate names and/or object names including spaces

    is an invitation to unending, perhaps even migraine, headaches.
    You mention that two tables share many of the same field names. They don't contain the same data, do they? If they do, you probably have a design problem with your database.
    HTH

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    I agree with hertfordkc concerning field and object names containing spaces and/or special characters --it will "get you" sooner or later.

    Do you have a data model? Do you have test data (both good and bad) Have you tested your data against the model? These are steps to ensure your structures are correct before you get into convoluted logic and programming to work around a structural issue.

    Can you post your tables and relationships? Or a copy of your mdb?

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

Similar Threads

  1. Default Min & Max Date Values in Form
    By alsoto in forum Forms
    Replies: 3
    Last Post: 10-03-2011, 10:54 AM
  2. Default Values in a form
    By handjor in forum Forms
    Replies: 3
    Last Post: 08-03-2011, 09:11 AM
  3. Multiple default values in listbox
    By rickscr in forum Forms
    Replies: 3
    Last Post: 04-07-2011, 09:49 AM
  4. Setting default values in columns
    By crownedzero in forum Programming
    Replies: 0
    Last Post: 06-17-2009, 06:45 AM
  5. Default Values
    By twainscott in forum Programming
    Replies: 0
    Last Post: 09-14-2006, 11:18 AM

Tags for this Thread

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