Results 1 to 10 of 10
  1. #1
    jree3000 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jun 2014
    Posts
    40

    Form not saving records

    I have not built a MS Access database for about 20 years. I was asked to create one for a client and I am having difficulty getting back into the swing of things. I'm working in Access 2013.

    Here is the problem I am having. I have linked several tables together using one to one relationships (linked the primary key ID). I then created a simple query containing fields from these tables that I need to incorporate into a form. The form is to be used by the client to enter new records. The form is bound to the query. All the data fields appear to be working properly. The problem is this: I go to the form, enter a new order, it autonumbers a new record, I save, go onto to a new record, enter more data, then close the form and when I go back there are no records.

    Upon investigating I see that the record data is being stored in the tables (not the record source query) and the tables are not linked together the way they should be. For example I want the autonumber ID to be the same across all tables. Right now it is not doing that, the ID numbers do not match. I figured when creating this that all the data would be store in the query, perhaps I am just confused, actually I am quite sure I'm confused.



    I want to be able to scroll through all existing records in the form, not just in the tables.

    Is there anyone here that can give me a hand and help me figure out what it is I am doing wrong here? Thanks in advance for your assistance.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Normally a form can be used to enter/edit data into only one table. A query with INNER JOIN(s) requires records in both/all tables for any records to display.

    Why are these 1-to-1 related tables - why not 1 table?

    Tables should not be linked on autonumber fields. One table should be primary and can have an autonumber PK but the other tables should save this value as a FK into a number field.

    Use form/subform arrangement.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Like June mentioned, two tables with a one to one relationship is synonymous with having one table.

    Also, queries and forms do not store data. You might be able to argue they do in memory via a recordset or data set. But, tables are the objects that store the data.

    Use queries to retrieve data. Use forms as graphical interfaces.

  4. #4
    jree3000 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jun 2014
    Posts
    40
    Many thanks for your time. I tried just making it all one table but many of the fields have a lookup relationship to other tables. I reached the maximum allowed (32) before finishing the fields in the table. So I figured if I broke them down into multiple table I may have more luck with that. Little did I know the can of worms I was opening. Back to the drawing board.

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    That's a lot of lookups!

    Recommend not building lookups in table, especially if alias is involved. Review: http://access.mvps.org/access/lookupfields.htm

    How many tables and how many fields? I suspect not a normalized structure. If you want to provide db for analysis, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    jree3000 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jun 2014
    Posts
    40
    I actually saw that page earlier today when I was looking for answers. It does a good job describing the perils of lookups but what are the "healthy" alternatives?

    My main table has 29 fields. I have lookups on about a dozen of those fields. The other 12 tables I have joined to the main table each have 6 fields, 3 of which being lookups, one being a yes/no check box. So all in all I am talking about 101 fields. Really i just want the capability to provide drop down choices for these fields within the form. If there is a better way than lookups to accomplish this, I am all ears.

    I would provide the db but it contains a lot of confidential data within the structure so I'd rather avoid that if at all possible.

    Based on what I've said here, what would be your suggested course of action?

  7. #7
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Create an actual RDBMS by converting each lookup field into a table.

    Use Comboboxes on forms to assign Primary Key values to the foreign key fields of the relative table.

  8. #8
    jree3000 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jun 2014
    Posts
    40
    Excuse my ignorance but how would I go about doing that? I have my table open in design view. I have one of the fields in question selected and the Lookup tab selected. Not sure where to go from there. Is the goal to just return the field to a regular text field and then set up comboboxes for those fields in the form?

  9. #9
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Kinda.

    However, you do not want your field to be type Text. You want it to be type Number. Probably of type Long Integer so it is compatible with the type Autonumber.

    This way your field can behave as a Foreign Key field.

    Don't go straight to creating combos. You need tables to base the combobox's RowSource on.

    Take the value list from your lookup field and use it to enter records in your new table. You could just skip to the combo and base the combo on its own value list. My preference is to use tables.


    Tables are easy to find and understand. Value lists are not easy to find and understand. Look Up Fields at the table layer are not easy to locate and understand.

  10. #10
    jree3000 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jun 2014
    Posts
    40
    Okay. I want to thank you both for your advice. I think you've given me enough to go on here. I'm gonna dive in and see if I can get this squared away tonight. Thanks.

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

Similar Threads

  1. Form not saving multiple records in Table
    By element32d in forum Forms
    Replies: 3
    Last Post: 05-14-2013, 01:32 PM
  2. saving records on a form
    By trailerdoctor in forum Forms
    Replies: 1
    Last Post: 04-15-2013, 11:02 PM
  3. Replies: 6
    Last Post: 06-09-2012, 08:17 AM
  4. form and pop form saving to different records
    By mejia.j88 in forum Forms
    Replies: 7
    Last Post: 02-16-2012, 02:42 PM
  5. stopping a form from saving records
    By LAazsx in forum Forms
    Replies: 4
    Last Post: 12-09-2010, 05:48 PM

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