Results 1 to 12 of 12
  1. #1
    johnv is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    10

    Subform Automatically changes every record to first item from the recordsource


    I have a bunch of subforms on the main form that pull from independent tables as the recordsource. When I try to add a new record in the 'Casework&Built-inBySpace_Table', I pull the combobox down and select one of the notes and it automatically changes it to the '18" deep countertop' no matter what I type/select. I have attached the database for reference.Police Programming Database.zip

  2. #2
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,407
    Police Programming Database-davegri-v01.zip
    See attached. Added all the space tables to the relationship diagram.
    BTW, you don't need all those queries for the rowsource of you combobox lookups.
    Instead of SELECT ......FROM the query
    Just
    Select ..... FROM the table.
    Delete the query unless it is used elsewhere.

  3. #3
    johnv is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    10
    I am still having the same issue with your copy. The issue is when i try to use the combobox, no matter what I select, it always defaults to the first item in the list and I cannot change it.

    As for the queries, the query was only used to keep the "units" value associated with the note. I stored the units value within the lookup of the note. Is there a better way to do this?

  4. #4
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,407
    I am still having the same issue with your copy.
    Maybe we're not looking at the same form. What form is it?

  5. #5
    johnv is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    10
    In the "Rooms_Mainform" There are subforms below. On the 2nd tab (Arch Notes) There is a "Casework + Built-in" subform shown as a datasheet. All of the subforms are built the same way but that is the only one I have added notes to the record source. I want to be able to select an option from the combobox here.

  6. #6
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,407
    OK. I see. Change the bound column from 3 to 1.

    Click image for larger version. 

Name:	casework.png 
Views:	16 
Size:	24.6 KB 
ID:	37804

  7. #7
    johnv is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    10
    So that solved one problem but created another. The reason it was set to 3 was because the "units" column was being pulled as well. I believe I am doing this wrong based on your previous column about getting rid of the queries. How do I take a row in the record source and bring multiple columns into the subform so that when I set the note, it automatically associates it with the same units?

  8. #8
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,407
    Don't see the problem... works fine for me.
    Click image for larger version. 

Name:	caseTwo.png 
Views:	14 
Size:	23.3 KB 
ID:	37805

  9. #9
    johnv is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    10
    That column works great now. The "Units" column should read "lf" for all 3 records but instead is reading the "ID" field from the record source.

  10. #10
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,407
    Police Programming Database-davegri-v02.zip
    See attached. I have Furniture and Casework subforms working.
    There are many changes. Take a close look at relationships. You will have to make the remaining subforms, tables and queries mimic casework and furniture.
    Make note of modifications to the queries for the subform recordsources, and the combobox rowsources, as well as the combobox properties. The furniture subform had property DataEntry=Yes. You don't want that in the others.
    Some duplicated fields have been removed, and some moved to another table. Table lookup have been removed. Calculated fields in tables have been removed (from the tables that I worked on, there are probably others).

  11. #11
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I would suggest you consider fixing other major (IMHO) errors in the table designs and field naming.

    You are using special characters in object names. Exanple: Casework&Built-in_Table (ampersand and dash)
    There are spaces in object names. Example: "Space Name"
    -------------
    Object names should be letters and numbers.
    Do not begin an object name with a number.
    NO spaces, punctuation or special characters (exception is the underscore) in object names
    -------------
    ## Objects include fields, tables, queries, forms, reports and Modules. ##



    Design errors:
    Click image for larger version. 

Name:	Design1.png 
Views:	10 
Size:	142.7 KB 
ID:	37823
    The tables in the RED area are NOT linked correctly.



    Look at these tables
    Click image for larger version. 

Name:	Tables1.png 
Views:	9 
Size:	94.5 KB 
ID:	37824
    They all have the same structure. I would have 1 table with 1 more field for the entry/record type (Areas. Display, Acoustics, Plumbing, etc)

    It really is a bad design (and confusing) when all of the tables have "ID" as the name of the PK field and the FK fields in other tables are different names.




    This one I am on the fence about. I kind of understand, but it just looks wrong!
    1 table linked to itself 3 times.......
    Click image for larger version. 

Name:	Links1.png 
Views:	10 
Size:	99.5 KB 
ID:	37825

  12. #12
    johnv is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    10
    I understand your suggestions and they are very good to note when naming tables, I am quite new to Access and database design in general but these changes are easy to standardize in the process so I will make them. As for the adjacency relationship, the goal is to be able to have a combo box of "spaces" that already exist in the project and be able to pick which spaces relate to one another and should be adjacent. I don't want the user to be able to manually type a space that does not already exist.

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

Similar Threads

  1. Replies: 10
    Last Post: 07-05-2017, 11:31 AM
  2. Replies: 1
    Last Post: 08-19-2015, 10:41 AM
  3. Replies: 1
    Last Post: 09-24-2014, 12:26 PM
  4. Replies: 4
    Last Post: 03-28-2014, 12:38 PM
  5. update recordsource of subform
    By AndyKim in forum Forms
    Replies: 1
    Last Post: 06-16-2009, 09:15 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