Results 1 to 13 of 13
  1. #1
    AhmedHashish is offline Novice
    Windows 10 Access 2019
    Join Date
    Dec 2023
    Posts
    5

    Filling multiple fields based on value

    Hello,
    I have created 1 combobox(list) and 3 text boxes that have dlookup function, so when I choose a value from a combox it populates text from another table into these 3 textboxes. The issue is that these text boxes are not bound to fields in the table, and thus the values generated in the text boxes are not stored in the table (except tor the value in the combo box, it gets stored).
    How do I overcome this? (Without vba please)
    * How to populate data within the table itself instead of using the form.
    Appretiate your help.

  2. #2
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,566
    If The fields are not bound then you will need VBA
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

  3. #3
    xps35's Avatar
    xps35 is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jun 2022
    Location
    Schiedam, NL
    Posts
    232
    I guess that the fields are unbound and not stored because they are stored in the "other table". So it looks ok.
    Groeten,

    Peter

  4. #4
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,566
    Can you upload what you currently have?
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

  5. #5
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    If you can derive the values based on the stored one in the combo then there is no need to stored them in the table, you use the same dLookups wherever you need those values.

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  6. #6
    AhmedHashish is offline Novice
    Windows 10 Access 2019
    Join Date
    Dec 2023
    Posts
    5
    @mike60smart
    Is there a way to populate data within the table and not the form?

  7. #7
    AhmedHashish is offline Novice
    Windows 10 Access 2019
    Join Date
    Dec 2023
    Posts
    5
    @xps35
    I have two tables. The one with the dlookup data, and the main table in which records are stored (the form stores data in the main table, and have few textboxes with dlookup, but they don't store any looked up data in the main table; which I am trying to figure out how to do so here ��).

  8. #8
    AhmedHashish is offline Novice
    Windows 10 Access 2019
    Join Date
    Dec 2023
    Posts
    5
    Quote Originally Posted by Gicu View Post
    If you can derive the values based on the stored one in the combo then there is no need to stored them in the table, you use the same dLookups wherever you need those values.

    Cheers,
    I need the data populated into the table, so I am able to revise data as a whole and not record by record, thats one thing.
    The other thing is, I will need to export the table to excel, so I have to get the these fields in the table filled as well (automatically using dlookup, or other methods of auto filling, hopefully not vba)

  9. #9
    AhmedHashish is offline Novice
    Windows 10 Access 2019
    Join Date
    Dec 2023
    Posts
    5
    Appretiate all responses. I will be checking this post for solutions you can help me with, and I highly appretiate all your help.

  10. #10
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    The other thing is, I will need to export the table to excel, so I have to get the these fields in the table filled as well (automatically using dlookup, or other methods of auto filling, hopefully not vba)
    without knowing any detail of your application, I would suggest the usual way would be not to export the table, instead you would export a query

  11. #11
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    I need the data populated into the table, so I am able to revise data as a whole and not record by record, thats one thing.
    The query used for export would also help you to revise data as a whole. The entire point of a properly structured database is to not duplicate data; whatever method you would use to store the same info in two tables would go against the normalization rules:
    https://www.techtarget.com/searchdat...abase%20theory.
    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  12. #12
    Join Date
    Apr 2017
    Posts
    1,679
    An example why is what you want to achieve a bad idea.

    You have some table where you store some info you use in other tables (a lookup/registry table). There you have an ID field (e.g. RegistryID), and any number of fields with various info about this registry entry.

    Now in some form based on another table, you want to have the info from registry table. You must have the foreign key field for RegistryID in this table, and on form you link it to combo, which saves The selected RegistryID into Foreign key of this form's source table, and instead of RegistryID value displays another value (or some combination of several values) in Registry table.

    Now let's assume, after some time you discover, that some info in Registry table was wrong. You correct this, and this correction will be present in all forms and reports in your program immediately!

    When you instead save all info from linked registry table record into you form source table too, then when you correct Registry info, the info in those fields is not corrected - unless you write a lot of code to correct all other tables containing this info too. You have to use e.g. afterUpdate event of the form where you manage Registry entries for this.

    The only reasonable situation, when you can add other Registry fields values into another table is for log files, which cant be edited after the record is saved. E.g. Sales log must always contain exactly same info you did send to client.

  13. #13
    xps35's Avatar
    xps35 is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jun 2022
    Location
    Schiedam, NL
    Posts
    232
    Quote Originally Posted by AhmedHashish View Post
    I have two tables. The one with the dlookup data, and the main table in which records are stored (the form stores data in the main table, and have few textboxes with dlookup, but they don't store any looked up data in the main table; which I am trying to figure out how to do so here).
    The only data from the lookup tables you should store in the main table are the primary keys. If you have a PK value, you can find the rest of the data in the lookup table.
    Groeten,

    Peter

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

Similar Threads

  1. Replies: 4
    Last Post: 05-31-2019, 06:40 AM
  2. Auto-filling a field based on other fields?
    By TerraEarth in forum Access
    Replies: 9
    Last Post: 06-19-2018, 09:30 AM
  3. Replies: 7
    Last Post: 03-02-2016, 09:17 PM
  4. Replies: 4
    Last Post: 05-02-2014, 02:08 PM
  5. Replies: 1
    Last Post: 08-07-2011, 03:22 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