+ Reply to Thread
Results 1 to 22 of 22

VBA to Update Information on Multipage Form

  1. #1
    Forum Contributor
    Join Date
    03-12-2019
    Location
    USA
    MS-Off Ver
    2010
    Posts
    421

    VBA to Update Information on Multipage Form

    Hello,

    I have this repair system which has the ID for records AFR#. There are AFRsDB and AFRsParts sheets that contain the data. I created a multipage form for inputting, retrieving and editing this data.

    On my AFRsInput sheet there are requirements and a shape 'Show Form' for the multipage form.

    How can the form be programmed to fill the requirements please? (I have the requirements on the AFRsInput sheet)

    Thank you very much,
    FF

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    8,024

    Re: VBA to Update Information on Multipage Form

    Here's one way to do requirement#1:
    This goes in your userform module and will fire every time the value in textbox1 is changed. When it finds a match in column A of the AFRsDB sheet it will populate the form.
    I've only done the first few controls but you should be able to follow it and complete the rest.
    Please Login or Register  to view this content.
    I'll take a look at the other requirements and come back to it soon.

    BSB

  3. #3
    Forum Contributor
    Join Date
    03-12-2019
    Location
    USA
    MS-Off Ver
    2010
    Posts
    421

    Re: VBA to Update Information on Multipage Form

    Thank you BadlySpelledBuoy I will get to work on the rest of the controls.

  4. #4
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    8,024

    Re: VBA to Update Information on Multipage Form

    This amendment to the above code should take care of requirement#2. When it finds a match and populates the form it will lock the controls you mention from editing.
    Please Login or Register  to view this content.
    Got to go cook dinner for the kids now, but will come back to it after.

    BSB

  5. #5
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    8,024

    Re: VBA to Update Information on Multipage Form

    OOops, forgot to mention that for the above to work you need to put an x in the Tag property of the controls you want locked from editing.

    BSB

  6. #6
    Forum Contributor
    Join Date
    03-12-2019
    Location
    USA
    MS-Off Ver
    2010
    Posts
    421

    Re: VBA to Update Information on Multipage Form

    Okay I entered the other controls and it populates all the fields correctly now thank you BSB. I don't understand your addition though with the x's.

    I inserted command buttons on the form 'Lock' and 'Unlock'.

    The 'Lock' will lock all the cells the Clerk enters.

    The 'Unlock' will unlock those cells with a password to enable.
    Last edited by fredfarmer; 05-17-2019 at 01:57 PM.

  7. #7
    Forum Contributor
    Join Date
    03-12-2019
    Location
    USA
    MS-Off Ver
    2010
    Posts
    421

    Re: VBA to Update Information on Multipage Form

    In Post#6 I should have said the buttons will need codes to do that. I have a dream

  8. #8
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    8,024

    Re: VBA to Update Information on Multipage Form

    The bit with the x was my addition to automatically lock those controls when a match was found and the form populated.
    The controls have a "tag" property that can be set. By setting it for the controls you want to lock you can then loop through all the controls and lock only those with an x in the tag property and ignore the rest.

    This means no need for the Lock button you added.

    In the attached I've set all that up for you.

    I've also added code to the Unlock button that will ask for a password (currently set to Password) and will unlock those controls if it matches.

    Getting there?

    BSB
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    03-12-2019
    Location
    USA
    MS-Off Ver
    2010
    Posts
    421

    Re: VBA to Update Information on Multipage Form

    Thanks yes it is getting good!

  10. #10
    Forum Contributor
    Join Date
    03-12-2019
    Location
    USA
    MS-Off Ver
    2010
    Posts
    421

    Re: VBA to Update Information on Multipage Form

    How do the x's determine which text boxes, check boxes, or combo boxes to be locked?

    For the 'Clerk' area there needs to be more locked fields. All of the fields on the left column of the form plus the Customer Complaint and the Preliminary Inspection.

    My bad these work just fine. I forgot to click the 'Lock' button
    Last edited by fredfarmer; 05-17-2019 at 03:24 PM.

  11. #11
    Forum Contributor
    Join Date
    03-12-2019
    Location
    USA
    MS-Off Ver
    2010
    Posts
    421

    Re: VBA to Update Information on Multipage Form

    An update button might be needed to save any changes to the record. Also maybe next would be how to get the parts?

  12. #12
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    8,024

    Re: VBA to Update Information on Multipage Form

    Quote Originally Posted by fredfarmer View Post
    How do the x's determine which text boxes, check boxes, or combo boxes to be locked?

    For the 'Clerk' area there needs to be more locked fields. All of the fields on the left column of the form plus the Customer Complaint and the Preliminary Inspection.

    My bad these work just fine. I forgot to click the 'Lock' button
    You shouldn't need to click the Lock button. All of those controls should lock automatically when the tool finds a matching AFR.

    I will work on the update button now.

    BSB

  13. #13
    Forum Contributor
    Join Date
    03-12-2019
    Location
    USA
    MS-Off Ver
    2010
    Posts
    421

    Re: VBA to Update Information on Multipage Form

    I think the manually locking the clerk range is good for when entering a new AFR. When the Clerk enters all of the initial information then she can click 'Lock' to keep the techs from changing those cells. It seems they will accidentally try to mess up anything they can!
    Last edited by fredfarmer; 05-17-2019 at 03:52 PM.

  14. #14
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    8,024

    Re: VBA to Update Information on Multipage Form

    I don't know where you want your update button so I've just popped one at the top of the form.

    It works in a similar way to the retrieve code, but with things switched around.
    Here's a sample of it. Again you can add the rest of the controls.
    Please Login or Register  to view this content.
    Having thought about it though you don't necessarily need to include the "locked" controls if they cannot be updated.

    BSB
    Attached Files Attached Files

  15. #15
    Forum Contributor
    Join Date
    03-12-2019
    Location
    USA
    MS-Off Ver
    2010
    Posts
    421

    Re: VBA to Update Information on Multipage Form

    Okay I will get to work on the rest of the controls. As Sintek mentioned previously "baby steps".

    I appreciate all the help BSB

  16. #16
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    8,024

    Re: VBA to Update Information on Multipage Form

    Baby steps indeed. Wise words from Sintek!

    Happy to help where I can. I need to disappear for the evening soon but will come back to this tomorrow.

    In post #11 you said "maybe next would be how to get the parts?". I don't really understand what that means or what is needed so you'll have to give some guidance on that.

    BSB

  17. #17
    Forum Contributor
    Join Date
    03-12-2019
    Location
    USA
    MS-Off Ver
    2010
    Posts
    421

    Re: VBA to Update Information on Multipage Form

    The parts I mentioned I would like to have on the AFRsParts tab of the form. These parts will be associated with the AFR#. The tech will enter these parts to be ordered against this AFR#.

    Til tomorrow or Monday maybe thanks for everything. Cheers!

  18. #18
    Forum Contributor
    Join Date
    03-12-2019
    Location
    USA
    MS-Off Ver
    2010
    Posts
    421

    Re: VBA to Update Information on Multipage Form

    Oh I think I filled out the rest for the Update Data button.
    Last edited by fredfarmer; 05-17-2019 at 04:51 PM.

  19. #19
    Forum Contributor
    Join Date
    03-12-2019
    Location
    USA
    MS-Off Ver
    2010
    Posts
    421

    Re: VBA to Update Information on Multipage Form

    Would the AFRsParts tab have a multi column listbox?

  20. #20
    Forum Contributor
    Join Date
    03-12-2019
    Location
    USA
    MS-Off Ver
    2010
    Posts
    421

    Re: VBA to Update Information on Multipage Form

    Good day all,

    Does anyone know how to have parts on the other tab of the form that will stay with the AFR# ?

    Thank you,
    FF

  21. #21
    Forum Contributor
    Join Date
    03-12-2019
    Location
    USA
    MS-Off Ver
    2010
    Posts
    421

    Re: VBA to Update Information on Multipage Form

    please bump thank you
    Last edited by fredfarmer; 05-21-2019 at 07:10 AM.

  22. #22
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    15,026

    Re: VBA to Update Information on Multipage Form

    The parts I mentioned I would like to have on the AFRsParts tab of the form. These parts will be associated with the AFR#. The tech will enter these parts to be ordered against this AFR#.
    Again...This means nothing...What are the exact steps that need to be followed that you are wanting code to be written for...
    Upload sample files with before | after scenarios depicted...
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Update textbox on multipage
    By MIFF3436 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-13-2014, 12:44 PM
  2. [SOLVED] ActiveControl - Return non-Multipage control when Form contains Multipage?
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-04-2014, 08:37 PM
  3. [SOLVED] have code need user form to automatically update existing information
    By Jeff up North in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-31-2013, 03:37 PM
  4. Replies: 2
    Last Post: 09-16-2012, 04:39 PM
  5. MultiPage Form
    By Bob@Sun in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-11-2010, 06:04 AM
  6. Multipage Form
    By northernstar197 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-19-2007, 05:40 PM
  7. [SOLVED] multipage form
    By Sandy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-06-2005, 03:06 AM

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