Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-02-2023, 04:50 PM
Krhamm Krhamm is offline Number of Tables based Off Quantity Selected in Drop Down List Windows 11 Number of Tables based Off Quantity Selected in Drop Down List Office 2021
Novice
Number of Tables based Off Quantity Selected in Drop Down List
 
Join Date: Dec 2023
Posts: 11
Krhamm is on a distinguished road
Default Number of Tables based Off Quantity Selected in Drop Down List

I have a table that will be used to fill out information about a specific piece of equipment. I want that table to show up X number of times based off the quantity selected from a dropdown, up to 6 to be specific.



So say I have 3 pieces of this equipment, I would select 3 in the drop down, and 3 of the same table would show up so that each piece of equipment can have its own table to enter in its information.

Is this possible and, if so, how can I do it?

Thanks for the help!
Reply With Quote
  #2  
Old 12-02-2023, 11:41 PM
Guessed's Avatar
Guessed Guessed is offline Number of Tables based Off Quantity Selected in Drop Down List Windows 10 Number of Tables based Off Quantity Selected in Drop Down List Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Select one instance of the table along with a paragraph above and below that table and then go to the Developer Tab and click on the Repeating Section Content Control button.

You can then use the plus button on the bottom right to add more sections. You can right click to add or remove sections. You can also add a macro to ask for a count and do them all at once.
Code:
Sub RepeatMe()
  Dim aCC As ContentControl, iCount As Integer
  Set aCC = ActiveDocument.SelectContentControlsByTitle("Repeater")(1)
  iCount = InputBox("How many?", , 5)
  With aCC.RepeatingSectionItems
    If iCount > .Count Then
      Do While .Count < iCount
        .Item(.Count).InsertItemAfter
      Loop
    ElseIf .Count > iCount Then
      Do While .Count > iCount
        .Item(.Count).Delete
      Loop
    End If
  End With
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 12-03-2023, 05:59 AM
Krhamm Krhamm is offline Number of Tables based Off Quantity Selected in Drop Down List Windows 11 Number of Tables based Off Quantity Selected in Drop Down List Office 2021
Novice
Number of Tables based Off Quantity Selected in Drop Down List
 
Join Date: Dec 2023
Posts: 11
Krhamm is on a distinguished road
Default

Thank you for the reply. I apologize though, I am a newbie. I am currently using legacy forms, will using content controls muddy up my form and possibly cause issues when users try to fill out this form? This form will be distributed to my team and they will use this when they need it.

Edit: I just realized that I left out a piece of information that may change your answer. I want to lock this fillable form so that the user cannot modify anything other than the fields and dropdowns I have provided. So they would need to be able add tables either by clicking the quantity of tables in a dropdown or if they could have access to a button such as + or add, that would work too.
Reply With Quote
  #4  
Old 12-03-2023, 04:11 PM
Guessed's Avatar
Guessed Guessed is offline Number of Tables based Off Quantity Selected in Drop Down List Windows 10 Number of Tables based Off Quantity Selected in Drop Down List Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

I've seen multiple knowledgeable people on this forum say that you shouldn't combine Content Controls with legacy form fields so you probably shouldn't do that (although I'm unconvinced this is a real problem).

If it was me, I'd be throwing away the legacy form fields and replacing them with content controls (and as a bonus, adding a custom xml file to link the fields to). There should be no real change to the way the users add data with the form although the ability to add/remove tables would be new to them either way.

If you stay with the legacy fields, you can still use locked forms if you are using with macros to do the add/remove. Changing to Content Controls removes the need for macros while still being in a locked form.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #5  
Old 12-03-2023, 07:49 PM
Krhamm Krhamm is offline Number of Tables based Off Quantity Selected in Drop Down List Windows 11 Number of Tables based Off Quantity Selected in Drop Down List Office 2021
Novice
Number of Tables based Off Quantity Selected in Drop Down List
 
Join Date: Dec 2023
Posts: 11
Krhamm is on a distinguished road
Default

I chose legacy form fields due to the types of things I needed to do within the form, such as auto-populating text fields, dependent drop down lists, etc.

I've been thinking, I assume if I add 6 drop down lists with yes or no options and then have a table populate based off the answer for each drop down, I think that could work. However, I'm not quite sure that would look very clean for the user and recipient of the form(The user emails this form to a customer once completed). I'm hoping there is another way. I appreciate your help with this.
Reply With Quote
  #6  
Old 12-04-2023, 03:34 PM
Guessed's Avatar
Guessed Guessed is offline Number of Tables based Off Quantity Selected in Drop Down List Windows 10 Number of Tables based Off Quantity Selected in Drop Down List Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

I'm sure there is another way. If you want other suggestions then someone else may chip in here.

I don't have other suggestions without seeing what you are starting with. I assume you have macros to do the dependent drop down lists for instance and that has a major bearing on how the changes can be applied.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #7  
Old 12-05-2023, 10:41 AM
Krhamm Krhamm is offline Number of Tables based Off Quantity Selected in Drop Down List Windows 11 Number of Tables based Off Quantity Selected in Drop Down List Office 2021
Novice
Number of Tables based Off Quantity Selected in Drop Down List
 
Join Date: Dec 2023
Posts: 11
Krhamm is on a distinguished road
Default

I tried using the Repeating Section Content Control like you suggested. The issue is that I need the plus button there for the user to be able to select. With the form locked, that plus sign is not there, telling me this is only available while protections are not in place, and I cant have an unprotected form sent out as a company document.

Currently I have 2 forms as a workaround that allows up to 3 devices or up to 6 devices. I'm still interested in figuring this out as this would make the form look much cleaner and simplify the process, instead of having to have 2 forms. Again, I appreciate your help!

EDIT: I also tried out the date picker content control with the same form using legacy forms and so far it has had no issues. I have another person testing it and it seems to work just fine. This goes to your theory that using both types of content controls doesnt cause issues.
Reply With Quote
  #8  
Old 12-05-2023, 02:37 PM
Guessed's Avatar
Guessed Guessed is offline Number of Tables based Off Quantity Selected in Drop Down List Windows 10 Number of Tables based Off Quantity Selected in Drop Down List Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

The repeating sections Plus button works for me when the document is protected for forms. I can also right click to add or remove repeats. I don't know why it isn't working for you.

You may have problems with the calculation field in your other thread if that is involved in this repeating section - that would be pushing the envelope of blending legacy and CC combinations.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a drop down list that if (a) is selected then (x) happens mummarochy Word 1 06-11-2018 10:07 PM
Show/ hide three sections of a cover page based on the option selected in the drop down list raizadamili Word 3 04-18-2018 06:56 AM
Drop down box list based on response to another drop down box Phideaux Excel 16 04-13-2018 03:07 AM
numbered list: bold when selected and fade when selected following number village PowerPoint 0 11-08-2017 10:43 AM
Need macro to fill data from different sheets based on selected item from drop down skorasika Excel Programming 1 03-13-2015 11:25 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:09 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft