Results 1 to 6 of 6
  1. #1
    cbramsey is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2017
    Posts
    40

    Combo Box, Losing my mind

    I took 3 years off from Access work and I feel like I can't do anything now.

    I have the following

    "Ownership" - Table
    -owner number
    -owner name
    -tract ownership
    -royalty decimal

    "Active Owners" - Query - This query filters the master owner information table to display on the active owners


    -Owner Number
    -Owner Name

    "Active Owners_Name" - Query - This uses the owner number to return a name
    -Owner Number
    -Owner Name

    I have a form setup to enter data into the OWNERSHIP table, what I want to do is to input the owner number in the form and have the name autopopulate. I also want to ensure that the number entered into the Owner Number is valid.

    What I did was enter a Combo box that is tied to the ACTIVE OWNERS Query, this only shows me the owner number, ideally I would like to see the Owner Number and Owner Name in the box when selecting. Any help would be great, I know this is fairly easy, I just can't seem to get it.

    Thank you

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,649
    Why do users need to see Owner Number? Only one value can display in the box but multiple values can display in the dropdown list. Do you want users to select owner by typing number or name?

    Set combobox properties:

    ControlSource: the field where you want to save the [Owner Number]
    BoundColumn: 1
    ColumnCount: 2
    ColumnWidths: 0.25"; 2" (or use 0";2" to hide the number and type name)


    Advise no spaces or punctuation/special characters (underscore only exception) in naming convention. Better would be OwnerNumber, Owner_Number, OwnerNum, Owner_Num.

    Is [Owner Name] names of individuals like John Smith? Name parts should be in separate fields: LastName, FirstName, MidName, Title, Suffix.

    Don't really need multiple query objects to accomplish. An SQL statement can be typed directly into RowSource (can even open the query design by clicking the ellipses (...))

    At least instead of the second query, do whatever you do to pull in name in that query in the first one.
    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
    cbramsey is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2017
    Posts
    40
    The field names do have the underscore in the name, unfortunately, the owner name data is coming from a linked database table to our main system and it is set up with the entire name in one field. As for needing the number and the name, we are working to do an export of the data and require both data points. I think my problem was that I was starting by building a form using the table fields as opposed to creating the combo box field and tying it back to the table field. Once I select the Owner Number, how can I get that to populate the query that will automatically populate my owner name field? I have done this in the past but like I said, I was away from Access for awhile and now feel like I am treading water to get back into all of the little quirks.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,649
    Review post 3 in https://www.accessforums.net/showthread.php?t=66009

    For your export, build a query that includes both tables (basically option 1 in the referenced thread)
    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.

  5. #5
    cbramsey is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2017
    Posts
    40
    When I do that I get the #name? error

    I have the following formula under the Control Source - =[Active_Owners_Name]![Owner_Name]
    Locked = Yes
    Tab Stop = No

    In the Active_Owners_Name Query I have the following
    under Owner_Number
    [FORMS]![NRI_Entry]!
    [List2]

    List 2 is the list box that is storing my owner number, once I get this figured out I will name more appropriately

    In the List2 box on the form, it is set requery the owner_name afterupdate

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,649
    Do not use a query object as a form RecordSource if that query references the form for dynamic filter criteria. I NEVER use dynamic parameterized query objects.

    Cannot reference a table or query object directly in a textbox. The table or query has to be included in the form or report RecordSource. Then just reference the field name. So form RecordSource could be an SQL statement typed directly into the property (or open the query designer by clicking the ellipses ...). The SQL would be like:

    SELECT Ownership.*, MasterOwnerTable.* FROM MasterOwnerTable RIGHT JOIN Ownership ON MasterOwnerTable.OwnerID = Ownership.OwnerID;

    Then build a query object for your export or build a report for export.
    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.

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

Similar Threads

  1. Recordsets blowing my mind
    By Gina Maylone in forum Access
    Replies: 9
    Last Post: 04-22-2016, 03:58 AM
  2. Losing my mind. "Extra ) in query expression"
    By shin_mitsugi in forum Access
    Replies: 6
    Last Post: 11-25-2015, 08:33 AM
  3. Replies: 3
    Last Post: 10-30-2013, 05:59 AM
  4. Exporting to Excel- losing data from combo box
    By SteveS in forum Import/Export Data
    Replies: 3
    Last Post: 07-17-2012, 01:07 PM
  5. Losing my Mind: developer tab
    By silverspr in forum Access
    Replies: 2
    Last Post: 12-27-2011, 12:35 PM

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