#31
|
|||
|
|||
Ok now it runs but my button doesn't work. Are you tired of me posting yet?
Code:
Private Sub CommandButton1_Click() Dim i As Long, StrOut As String Call UpdateBookmark("bmdate", TextBox1.Value) Call UpdateBookmark("bmname", TextBox3.Value) Call UpdateBookmark("bmlicense", TextBox2.Value) Call UpdateBookmark("bmaddress", TextBox4.Value) Call UpdateBookmark("bmfname", TextBox5.Value) Call UpdateBookmark("bmcase", TextBox6.Value) Call UpdateBookmark("bminspection", TextBox7.Value) Call UpdateBookmark("bmcdate", TextBox8.Value) Call UpdateBookmark("bmctime", TextBox9.Value) For i = 0 To ListBox1.ListCount - 1 If ListBox1.Selected(i) Then StrOut = StrOut & ListBox1.List(i) & vbCr End If Next i Call UpdateBookmark("bmviolations", StrOut) End Sub Sub UpdateBookmark(StrBkMk As String, StrTxt As String) Dim BkMkRng As Range With ActiveDocument If .Bookmarks.Exists(StrBkMk) Then Set BkMkRng = .Bookmarks(StrBkMk).Range BkMkRng.Text = StrTxt .Bookmarks.Add StrBkMk, BkMkRng End If End With Set BkMkRng = Nothing End Sub Private Sub UserForm_Initialize() TextBox1.Value = Format(Date, "mm/dd/yyyy") With ListBox1 .AddItem "D1 Failure to obtain a dealer license or dealing in vehicles without a valid license. Section 248(5)" .AddItem " Failure to obtain a salvage vehicle agent license. Section 248e(1)" .AddItem "D2 Failure to renew license. Business open. No vehicles bought or sold. Section 248(5)" .AddItem "D3 Failure to renew license. Business open. Vehicles bought or sold. Section 248(5)" .AddItem "D4 Failure to obtain a supplemental license. Section 248(7" .AddItem "D5 Failure to amend license information." .AddItem " Main location. Section 248(6)" .AddItem " Supplemental location. Section 248(7)" .AddItem "D6 Failure to comply with inventory loan requirements. Section 235b" .AddItem "D7 Exceeding authority granted by license. Section 248(8)" .AddItem "D8 Failure to meet established place of business requirements." .AddItem " A & B Dealers. Section 14(2)" .AddItem " W Dealers. Section 14(3)" .AddItem " R, C, F, & H Dealers. Section 14(1)" .AddItem "D9 Improper use of temporary registration." .AddItem " Gray-shaded area on RD-108 not completed or not properly completed. Section 217(6)" .AddItem " Issued more than one BFS-4. Section 226a(1)" .AddItem " BFS-4 sold outside of vehicle purchase, missing from inventory, used for personal use, on a vehicle not in inventory or when not permitted. Section 256" .AddItem "D10 Improper temporary registration recordkeeping. Sections 251(5) & 251(7)" .AddItem "D11 Failure to have police book or washout system." .AddItem " A, B, D & W Dealers. Section 251(1)" .AddItem " C & R Dealers. Section 251(9)" .AddItem " E Dealer. Section 251(6)" .AddItem " F Dealer. Section 251(10)" .AddItem " G Dealer. Section 251(8)" .AddItem " H Dealer. Section 251(11)" .AddItem " Scrap metal processors not required to be licensed. Section 251(5)" .AddItem "D12 Failure to maintain police book or washout system." .AddItem " Information required. Section 251(2)" .AddItem " Maintained for 5 years and available for inspection. Section 251(7)" .AddItem "D13 Proper sales tax not submitted with RD-108. Section 815" .AddItem "D14 Misrepresenting a vehicle as new, demonstrator, executive, manufacturer, leased or used. Section 248a" .AddItem "D15 Records not available for inspection during reasonable or established business hours. Sections 251(5) & 251(7)" .AddItem "D16 Failure to make application for title and registration in purchaser's name within 15 days of vehicle delivery. Section 217(4)" .AddItem "D17 Improper use of dealer plates." .AddItem " Service car, wrecker or allowing misuse. Section 244(6)" .AddItem " More than 72 hours for vehicle delivery. Section 244(9)" .AddItem " More than 72 hours for a test drive. Section 244(10)" .AddItem " Allowing another, not entitled, to use special plate. Section 256" .AddItem "D18 Failure to have properly assigned certificate of title in immediate possession." .AddItem " Assigned title with the odometer information properly completed. Section 235(1)" .AddItem " Shall not accept an odometer statement or title which has not been completely filled in by the transferor. Section 233a(4)" .AddItem "D19 Temporary registration records not available." .AddItem " Failure to present BFS-4 log for inspection or have log. Section 251(7)" .AddItem "D20 Failure to provide copies of a document at time of signing. Section 251a" .AddItem "D21 Failure to properly complete RD-108." .AddItem " Vehicle description (make, body style, model year, miles, special use boxes, weight or fee category). Section 217(1)(b)" .AddItem " Applicant's title, security interest name and address, accessories to the vehicle. Section 217(1)(c)" .AddItem " BFS-4 not recorded. Section 226a(3)" .AddItem " Name and address of seller and buyer, vehicle info, $$, description of trade-in, amount of vehicle insurance, type of insurance, charge for BFS-4, other charges and purpose, RD-108 dated, but not later than the actual date of delivery. Original and all copies identical info. Seller furnishes statement, signed by seller or seller's agent and buyer, filed w/SOS by seller. Section 251(3)" .AddItem "D22 Failure to apply for in-transit registration for out-of-state retail consumer taking delivery of vehicle in this state. Section 226(10)" .AddItem "D23 Failure to adhere to business hours on file with Secretary of State. Section 248a(2)" .AddItem "D24 Odometer alteration. Section 233a(6)" .AddItem "D25 Fraudulent act in connection with selling or otherwise dealing in vehicles. Section 249(d)" .AddItem "D26 Miscellaneous." .AddItem "D27 Improper odometer disclosure." .AddItem " No odometer disclosure. Section 233a(1)" .AddItem " Signing title as buyer and seller. Section 233a(3)" .AddItem "D28 Failure to maintain odometer disclosure records. Section 233a(11)" .AddItem "D30 Possession of a stolen vehicle. Section 254" .AddItem "D31 Failure to deliver title upon transfer of a vehicle to a dealer or consumer." .AddItem " To a dealer. Section 235(3)" .AddItem " To a consumer. Section 234(2)" .AddItem "D32 Selling or offering for sale a new vehicle without a franchise. Section 249(c)" .AddItem "D33 Violation of probation agreement." .AddItem "D34 Violation of suspension agreement." .AddItem "D35 Failure to properly complete broker's fee agreement. R 257.189" .AddItem "D36 Failure to give copy of broker's fee agreement. R 257.189" .AddItem "D37 Failure to properly complete broker purchase agreement. R 257.188" .AddItem "D38 Failure to give copy of broker purchase agreement. R 257.188" .AddItem "D39 Failure to disclose identity as a broker. R 257.187" .AddItem "D40 Salvage pool release vehicle before title issued. Section 217f" .AddItem "D41 Failure to apply for salvage or scrap title within 5 days. Section 217c(4)" .AddItem "D42 Failure to properly prepare TR-9 Scrap Vehicle Inventory. Section 217c(18)" .AddItem "D43 Failure to forward copies of TR-9 with the vehicle. Section 217c(18)" .AddItem "D44 Failure to forward titles to the Secretary of State. Section 217c(18)" .AddItem "D45 Failure to have major component parts record (SOS-426). " .AddItem " G Dealers. Section 251(8)" .AddItem " C & R Dealers. Section 251(9)" .AddItem " H Dealers. Section 251(11)" .AddItem "D46 Failure to maintain major component parts record (SOS-426)." .AddItem " G Dealers. Section 251(8)" .AddItem " C & R Dealers. Section 251(9)" .AddItem " H Dealers. Section 251(11)" .AddItem "D47 Failure to assign number to major component part." .AddItem " G Dealers. Section 251(8)" .AddItem " C & R Dealers. Section 251(9)" .AddItem " H Dealers. Section 251(11)" .AddItem "D48 Failure to give proper salvage vehicle disclosure. R 257.253" .AddItem "D49 Foreign alteration." .AddItem "D50 Former branded title status washed. Section 217(1)" .AddItem "D51 Failure to amend salvage vehicle agent license. Section 248e(7)" .AddItem "D52 Scrap titled vehicle issued clear title in Michigan or other state. " .AddItem " Class R, C, F, G, E, H or D who removes a scrap vehicle from this state for the purpose of rebuilding, or selling to a person other than a scrap metal processor. Section 217c(22)" .AddItem " Class R, C, F or H who removes a scrap vehicle from this state for the purpose of rebuilding or has sold the unit for the purpose of rebuilding. 249a(2)(e)" .AddItem "D53 Salvage pool/auction sold vehicle to other than former owner, or licensed salvage agent of an automotive recycler, or foreign salvage dealer. Section 248c(3)" .AddItem "D54 Failure to disclose previous damage on new vehicle. Section 233b" .AddItem "D55 Altering or using false or altered registration or title assignment." .AddItem " Improper use of title or registration. Section 256" .AddItem " Alters title or registration with fraudulent intent. Section 257(1)(a)" .AddItem " Holds or uses such document knowing the same to have been altered, forged, or falsified. Section 257(1)(d)" .AddItem " Knowingly possess, sell or offer false, counterfeit or stolen title or registration. Section 257(1)(e)" .AddItem "D56 Failure to maintain a properly executed dealer surety bond with good and sufficient surety (A, B, & D Dealers). Section 248(2)" End With lbl_Exit: Exit Sub End Sub |
#32
|
||||
|
||||
Perhaps you could attach the actual document to a post (delete anything sensitive). You can do so via the paperclip symbol on the 'Go Advanced' tab at the bottom of this screen.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#33
|
|||
|
|||
Ok after some random code insertion it seems to be working. What got it working was changing this:
Code:
Call UpdateBookmark("bmctime", TextBox9.Value) For i = 0 To ListBox1.ListCount - 1 Code:
Call UpdateBookmark("bmctime", TextBox9.Value) Me.Repaint UserForm1.Hide For i = 0 To ListBox1.ListCount - 1 |
#34
|
||||
|
||||
I suspect all you needed to do was re-start Word...
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#35
|
|||
|
|||
Probably knowing my luck. Thanks for all your help, I truly appreciate it.
|
#36
|
|||
|
|||
I've just registered here as I'm trying to find a way to do the multi-select drop down in Word 2016 myself and am looking for options. I've downloaded your "helpdoc.docm" which is useful, but doesn't give me what I want exactly. I hope you can help?
I think the best option for me, based on what I've read so far is to use a userform with a drop down on it. What I need to do is be able to: 1. Select a cell within a table in Word, 2. Have the form / drop down list pop up, 3. Select 1 or more options from the list, 4. Confirm and enter those choices into the table as text. 5. need to be able to re-select again by clicking in the cell (if possible)? Would there be any change of getting another helpdoc.docm posted with the basics and code. Doesn't need to be pretty, I can format, etc. Regards, Steve. |
#37
|
||||
|
||||
It is always better to start a new thread than to latch on to someone else's thread.
From your description, what you require here is a list box content control inserted into the cell. You may find Insert Content Control Add-In useful. A userform that writes a value to a cell is possible, but then there is an additional problem of how to activate it - especially for re-editing it.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
Tags |
form, multi drop down |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Change color according with dropdown selection | spk | Word VBA | 43 | 07-31-2022 03:51 PM |
Auto text after selection from Dropdown menu | trainsy | Word | 2 | 06-04-2014 04:43 AM |
block selection in dropdown list | Intruder | Excel | 2 | 01-10-2013 10:20 AM |
Dropdown selection value | coconutt | Word VBA | 5 | 09-13-2012 05:23 PM |
Autofill a form which is contingent on a dropdown selection. | biffle0764 | Word | 2 | 05-09-2012 12:54 PM |