Results 1 to 12 of 12
  1. #1
    Join Date
    Nov 2008
    Posts
    4

    Unanswered: Autofilled fields on form dont record on table

    Hi All,

    Any assistance would be greatly appreciated!! (This is my first database by the way)

    I need to fill in a form as easily as possible. Within this form are a number of fields which are required. Supplier details, Part details etc. On filling the Supplier name field my intention is to autofil the remaining suppliers detail fields. I have managed to do this some how!! (by bounding the boxes to the supplier name, drawing from a seperate table which contains all the supplier details). However when I go to the table which the form fills only the first combo box is recorded. Is there an easy way to resolve this or am I better starting again? (Or have I totally misunderstood how a database should work)

    Thanks again

  2. #2
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    So the problem is that your form isn't filling in the right fields?

    Check the Control Source of your form controls to see if they are bound to the correct fields, and make sure you have all the right fields included in the form's query. It should contain all the fields from the table the form is trying to populate, plus those non-key supplier table fields.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  3. #3
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Are you setting the value or the defaultvalue for these fields?

    What I sometimes do is set the .defaultvalue to a variable (or the current value) and then issue the docmd.gotorecord,,acnewrec

    You may also need to put in a "Refresh" command at places on your form (ie. in the lost focus event of where you set the defaultvalue.)
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  4. #4
    Join Date
    Nov 2008
    Posts
    1

    similar question

    Hello there!

    I have a similar problem... I am also quite new to MS Access and try to create a database which has to generate a few codes for identification.

    I managed somehow to generate the wanted values in the form but it will not save those values in the table.

    I was thinking it should be an easy task but I don't find the way to get these values stored for further processing.

    Can anyone please advice me how to go on the best way?

    Thanks,
    Hifi

  5. #5
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Perhaps you should make a new topic for this, otherwise I'd call it a nice topic hijack
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  6. #6
    Join Date
    Nov 2008
    Posts
    4
    Hi StarTrekker

    [QUOTE=StarTrekker]So the problem is that your form isn't filling in the right fields?

    When I select the First filed on the form, say company name the form does fill in the the remaining fields Address line 1, 2, 3 etc. When I close and save the form and open the table that the form is feeding into only the company name appears and the remaining Address lines are empty. I need to generate a report from this table and the full address needs to be on it.

    Is this any help?

    When you say non-key supplier table fields, are these fields that are on the supplier table but are not needed on the form. These should also be included on the query?

    Thanks again.
    Last edited by coldfishncustard; 11-26-08 at 14:16.

  7. #7
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    it looks like you have accidentally done it right. why do you want to stuff a table full of n-duplicate data that already exists in a seperate table which contains all the supplier details ? (BTW there can be reasons to do this sometimes, but it is not everyday)

    run your report off a JOIN query (can't say more without some knowledge of your tables and the report you are trying to run) that brings in the details where you need them.

    izy
    currently using SS 2008R2

  8. #8
    Join Date
    Nov 2008
    Posts
    4
    izy

    [quote]why do you want to stuff a table full of n-duplicate data that already exists in a seperate table which contains all the supplier details ?

    Thats what I thought, thats why I said at the end of the initial post - (Or have I totally misunderstood how a database should work).

    I think I know what you mean, Im just over complicating things. If the form has just one field to fill, Supplier name, I can then run a query on the table linking the supplier name to the supplier table and bring the required information into the report that way?

    I'll see what I can do by fudging my way through it (sort of worked so far and makes for a more interesting learning experience). If I have any problems I'll pst back on here.

    Thanks Izy (and everyone else) for your time

  9. #9
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    There is 1 good reason for duplicating data in the main table - fast return on records (ie. it's much quicker returning xx million records without joining another table in the query). But again, only for LARGE recordsets and the need to do computations/returns quickly. Otherwise, it is usually frowned upon duplicating data in another table.

    In regards to the issue of not writing to the table...
    1. Make sure the field(s) on the form are bound to actual data fields (ie. not unbound - the fields have a controlsource.)
    2. If unbound, you'll need to write code to update (or put the fields on the form somehow and update them.)
    3. If the fields are bound, try issuing a "Refresh" command at some point after the company name is updated.
    Last edited by pkstormy; 11-26-08 at 20:37.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  10. #10
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    I think it would be good to see the structure of your tables. I suspect there may be a design fault which might be confusing you?
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  11. #11
    Join Date
    Nov 2008
    Posts
    4
    Hi Startrekker (Sorry for delay in responding).

    Set up/Structure is as follows

    A number of tables which have all the relevant infomation with forms created to add additional values when required.

    Table 1 - Supplier ( Name, address) with subform for supplier contacts.
    Table 2 - Vehicle type (single field)
    Table 3 - Parts (Part description, part number) (I don't have these associated to the suppliers yet).
    Table 4 - Colour variants (single field)
    Table 5 - Problem description (single field)
    Table 6 - Inspectors ( name, surname)
    Table 7 - Detection location (single field)

    From the information above I've created 3 further tables that pull from these, these record the date and quantity of an incident/event. As all three tables require almost the same information I thought that this would be the best way to structure it. I will need to create further Tables using the above information too.

    Table A - Problems found at the customer.
    Table B - Problems created internally
    Table C - Problems found internally, received from supplier. (The table i'm trying to get to grips with in this thread)

    From these tables i have a number of queries that create reports.

    Report 1 - Daily performance, Internally & externally.
    Report 2 - Supplier reject notification (Need Table C to create this).

    Is this what you would expect to see?

    Cheers again chaps

  12. #12
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    It's a start....

    When I select the First filed on the form, say company name the form does fill in the the remaining fields Address line 1, 2, 3 etc. When I close and save the form and open the table that the form is feeding into only the company name appears and the remaining Address lines are empty.
    Critical questions you need to answer here:

    1. Which form are you creating?
    2. Which table are you opening?

    I need to generate a report from this table and the full address needs to be on it.
    3. Which table?

    I think your problem is directly related to this:

    make sure you have all the right fields included in the form's query. It should contain all the fields from the table the form is trying to populate, plus those non-key supplier table fields.
    You asked:

    When you say non-key supplier table fields, are these fields that are on the supplier table but are not needed on the form. These should also be included on the query?
    Non key fields are all the fields which are not "foreign keys" or "primary keys" of the supplier table. Yes, they need to be in the form's underlying query.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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