+ Reply to Thread
Results 1 to 13 of 13

Help needed to link combobox and textboxes

  1. #1
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Question Help needed to link combobox and textboxes

    Folks,

    I have a database in access 2010 with master table and a form, can you please tell me how to link the combobox1, Combobox2 and textboxes, for example if I select the combobox1 "Asset" I want to show the relevant data in combobox2 "TAG Number", then if I select any value in combobox2 all the text boxes values need to be changed based on table records, and, I want to print the selected records when I hit the print Button. I have attached the access database for your reference.

    Thanks in advance,
    Joshi
    Attached Files Attached Files
    Cheers,

    Joshi
    Being with a winner makes you a winner

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2403 Win 11 Home 64 Bit
    Posts
    23,810

    Re: Help needed to link combobox and textboxes

    Here are two links that will help you. The first is cascading combo boxes. The second is autofilling text boxes.

    http://www.fontstuff.com/access/acctut10.htm

    http://baldyweb.com/Autofill.htm

    alternatively, you could use this video as another means to do the same.

    http://www.datapigtechnologies.com/f...tomfilter.html

    The choice is yours as to which way you wish to go. If you go with the datapig solution, I would have just one lookup and make it have two fields visible.

    For printing the record, look at this db attached that does just that. Look at the code behind the button

    Alan
    Attached Files Attached Files
    Last edited by alansidman; 01-02-2013 at 02:14 PM.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Re: Help needed to link combobox and textboxes

    Hi Alan,
    Thanks for your advice,

    I have tried to fix the issues with your reference, but I could not fix it. Can you please help me to resolve the issue.

    Thanks in advance,
    Joshi

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2403 Win 11 Home 64 Bit
    Posts
    23,810

    Re: Help needed to link combobox and textboxes

    Will give it a shot in the next couple of hours.

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2403 Win 11 Home 64 Bit
    Posts
    23,810

    Re: Help needed to link combobox and textboxes

    Here's your db back. Test drive it.
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Re: Help needed to link combobox and textboxes

    Hi Alan,

    Thanks a lot, excellent codes. Can you do a small modification in that?, I want to use two combo boxes one for "Asset" (should be unique values, no duplicate records) and another one for "TAG Number" (should show relevant offset column records of "Asset"). Is it possible?

    Thank you very much for your time and supports.

    Joshi

  7. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2403 Win 11 Home 64 Bit
    Posts
    23,810

    Re: Help needed to link combobox and textboxes

    Had to give this some thought. Look here.
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Re: Help needed to link combobox and textboxes

    Hi Alan,
    Thank you so much for time and codes. But unfortunately still having some minor issue. 1) Please note that the form is not updating when I add new records ("Asset" & "TAG Number") in tblExchanger. 2) The printer button is does not working.

    Note: If I add any records in tblExchanger the report and form should be updated automatically.

    Please help me if possible.

    Thanks,
    Joshi

  9. #9
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2403 Win 11 Home 64 Bit
    Posts
    23,810

    Re: Help needed to link combobox and textboxes

    This should do it. I changed the record source for the combo boxes. I did not realize that you were going to add data and had set up a separate table originally for the combo boxes. I have reverted that back to the original table. Not sure why the print button had stopped as the code was there. Must of had to do with changing the record source for the form from the table (originally) to the query. Anyway, it appears to be working as you wish now. I would urge you to look at all the VBA code (not much of it) to understand what is happening here so that you are able to repair any issues in the future. It is an important part of learning to use this program is to understand what you have. Best of luck.

    Alan
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Re: Help needed to link combobox and textboxes

    Hi Alan,
    Excellent work, that's what I am looking for. Thank you so much.

    Joshi

  11. #11
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Question Re: Help needed to link combobox and textboxes

    Hi Alan,

    One more help please. When I open the form all texboxes values should be null. I have tried many ways, but I could not. Please help me.

    Thanks in advance,
    Joshi

  12. #12
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2403 Win 11 Home 64 Bit
    Posts
    23,810

    Re: Help needed to link combobox and textboxes

    Look at the latest update. I changed the form such that nothing is visible until you make your selections in the combo boxes.

    Alan
    Attached Files Attached Files

  13. #13
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Re: Help needed to link combobox and textboxes

    Hi Alan,
    Ohh great. thank you so much once again.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1