+ Reply to Thread
Results 1 to 26 of 26

How To Create Form and SubForm

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

    How To Create Form and SubForm

    Hello,

    I am starting over in my AFR System. How do I create a Form (to view from the AFRsInput sheet) from the AFRsDB (include all fields) and have a SubForm for parts assigned to the ID number (AFR#) ?

    I appreciate any help or guidance,
    FF

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

    Re: How To Create Form and SubForm

    Okay so far I have a form for the fields in the AFRsDB. How do I make them fill with information?

  3. #3
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,336

    Re: How To Create Form and SubForm

    Hi FredFarmer...

    Kudos to you for starting over...
    I suggest you start a new file...Don't make use of the existing file...
    Copy the important info over...Make use of ranges not Tables...
    Your Userform will need to have the same functions as your initial dropdowns on sheets etc etc...
    Take it one step at a time and explain in detail what you need to achieve...There are other members who have not followed your posts so have no idea what is going on...
    Look at attached...Will give you an idea of CombobBox population and Textbox fills with selection made...
    Many other ways that one can do this too...

    Also stick with the default names i.e TextBox1, TextBox2...You will see that it is easier to reference with code...
    Glad you kept the boxes in same order as Columns in sheet....
    Attached Files Attached Files
    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 star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

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

    Re: How To Create Form and SubForm

    Sintek,

    Thanks but did you see my latest file? I started a form layout but not sure how to populate the fields.

  5. #5
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,336

    Re: How To Create Form and SubForm

    Yes I did...But as I mentioned ... your initilal file had drop down selections and input selections which your New userform does not have...The sample was to show you what you need to do to replicate that...
    Afterall once all the fields are completed then you will be passing that info to the sheet...

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

    Re: How To Create Form and SubForm

    Okay I get it now I think. The fields for drop downs need to be combo boxes not text fields. The fields like Warranty need to be check boxes.

    Am I on the right track?

  7. #7
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,336

    Re: How To Create Form and SubForm

    Yes...So Repairmen & Technicians combobox population will be like such...
    Please Login or Register  to view this content.
    Also...As you are wanting some kind of protection...Steer clear of any direct sheet contact...You can literally do everything through UserForm Interface...

    Have your Buttons (menus) that are currently on a sheet as command buttons on another userform...And then call the different forms from those buttons...
    Last edited by sintek; 05-16-2019 at 02:20 PM.

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

    Re: How To Create Form and SubForm

    I inserted the module and checked the Repairmen and Technicians. There is nothing in the drop downs.

  9. #9
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,336

    Re: How To Create Form and SubForm

    Not a Module...Paste the code in the UserForm itself...Double click on Form and paste....

    And get rid of the Formulas in all the rows and rows and rows...Starting new...Start a new file!!!
    Your current file has a lot of baggage....

    Press Ctrl & End on each of your sheets and you will see how many unused rows you have...
    Last edited by sintek; 05-16-2019 at 02:45 PM.

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

    Re: How To Create Form and SubForm

    I added the other combo boxes:

    Please Login or Register  to view this content.

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

    Re: How To Create Form and SubForm

    Okay I put the code in the right place. As far as the formulas I have it down to row 300 so the Search sheet will cover up to that many possibilities.

  12. #12
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,336

    Re: How To Create Form and SubForm

    You don't need formula's....Make use of code to do everything...That way you will calculate per requirement...

    In below...Remove red part...

    Please Login or Register  to view this content.

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

    Re: How To Create Form and SubForm

    Okay I will need help with code for the Search sheet later of course. I want to focus on the form and subform for parts. I really appreciate the lessons.

  14. #14
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,336

    Re: How To Create Form and SubForm

    Yes...baby steps...

    When you start your next thread...Explain in detail what you want to achieve and always attach a sample file depicting your required results...
    For this post...You assumingly want to populate your form then write the info to the sheet...

    Get that done and then move to the next thread...

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

    Re: How To Create Form and SubForm

    Yes I need to attach these fields to the AFR# which is the ID.

    Is there code for the text boxes and check boxes like the combo box code?

  16. #16
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,336

    Re: How To Create Form and SubForm

    You will have to explain in more detail what needs to happen....Your form has comboboxes which are selections and textboxes which are inputs...

    This will give you an idea of how to get the completed form to your sheet...
    There are other methods as well...

    Please Login or Register  to view this content.
    Attached Files Attached Files

  17. #17
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,291

    Re: How To Create Form and SubForm

    Quote Originally Posted by sintek View Post
    Also stick with the default names i.e TextBox1, TextBox2...You will see that it is easier to reference with code...
    FWIW, I completely disagree with that. That's like using meaningless variable names.
    Remember what the dormouse said
    Feed your head

  18. #18
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,313

    Re: How To Create Form and SubForm

    @sintek
    John MacEnroe quote "Man you cannot be serious !!!!
    Also stick with the default names i.e TextBox1, TextBox2...You will see that it is easier to reference with code...
    When you run out of fingers you can count on your toes.
    This chap has had the guts to come back from one beating.
    Use meaningful titles otherwise everyone will again drown in another pool of mire.
    torachan.

  19. #19
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,912

    Re: How To Create Form and SubForm

    In the end it's everyone's own choice but personally I agree with sintek in this one

    I'd rather like to populate 30 Labels with Columnheaders using Application.Index and a loop than having to write 30 lines of code using the 'meaningful' names of the Labels.

    Also imho the risk of typos increases with the number of 'meaningful' names of objects.

    But since this discussion is irrelevant to this thread it might be better directed to The Water Cooler as a seperate thread.
    Last edited by bakerman2; 05-16-2019 at 06:13 PM.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  20. #20
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,336

    Re: How To Create Form and SubForm

    @ the Non-Believers...
    To each his own...I guess...I just prefer to follow the std 1,2,3...etc of life as it was intended...
    And as bakerman2 says...to have to remember all the "meaningful names" one has allocated is a nightmare and opens oneself up to errors...
    I personally don't want to have to try and understand why those specific names were used...Not to mention trying to make use of them in code...

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

    Re: How To Create Form and SubForm

    Good morning Sintek,

    I don't have my latest file with me but you mentioned I should start a new thread with details of how I want it. My vision is to have multi forms AFRsInput, AFRsParts, and one for reports. Does that make any sense and most important can it be done?

  22. #22
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,336

    Re: How To Create Form and SubForm

    Hi Fred...I'm certain it can be achieved...Has this thread been solved...Or is there more you need to do...

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

    Re: How To Create Form and SubForm

    I started with having a subform for parts too. I found that it is called multipage forms I think. So maybe I should continue with this one to get the information for the AFR from the AFRsDB sheet and the associated parts from the AFRsParts sheet. I should be back in a few hours on my other computer which has the file with the multipage form that I started.

    Thanks

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

    Re: How To Create Form and SubForm

    I did not realize your current time being afternoon sorry. It's 5:30 am here.

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

    Re: How To Create Form and SubForm

    Time to quit sorry. I realize everyone here is busy and I cannot do this on my own so I will unfortunately throw in the towel.

    Sorry I was having one of those days with frustrations and didn't know what to do. I welcome any help please.
    Last edited by fredfarmer; 05-21-2019 at 06:39 AM.

  26. #26
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,336

    Re: How To Create Form and SubForm

    I started with having a subform for parts too.
    Time to quit sorry. I realize everyone here is busy and I cannot do this on my own so I will unfortunately throw in the towel.
    I welcome any help please.
    For members this means nothing...You should be more clear as to what you want to achieve...Step by step explanations...We are not mind readers...
    I have been monitoring most of your posts from the start and still have no real idea what needs to be achieved...
    Last edited by sintek; 05-21-2019 at 03:39 PM.

+ 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. Datediff between Navigation form and subform
    By emina002 in forum Access Tables & Databases
    Replies: 0
    Last Post: 01-17-2019, 07:17 AM
  2. [SOLVED] Pass Value From Subform To Text Box Control On Other Form VBA
    By Excel4444 in forum Access Tables & Databases
    Replies: 2
    Last Post: 03-10-2016, 02:08 PM
  3. [SOLVED] Updating a counter on Parent form for Subform
    By pjwhitfield in forum Access Tables & Databases
    Replies: 1
    Last Post: 02-04-2015, 12:24 PM
  4. Replies: 1
    Last Post: 10-29-2014, 01:49 PM
  5. Replies: 2
    Last Post: 10-23-2014, 10:43 AM
  6. hide subform when open them main form
    By pedjvak in forum Access Tables & Databases
    Replies: 4
    Last Post: 04-09-2013, 08:21 PM
  7. [SOLVED] form/subform with buttons
    By BAZ in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-09-2006, 12:25 PM

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