View Single Post
 
Old 05-30-2018, 04:07 PM
Jailer Jailer is offline Windows 10 Office 2010 32bit
Novice
 
Join Date: May 2018
Posts: 7
Jailer is on a distinguished road
Default

Ok that works on the test document you posted, thank you. Now I can't seem to get it to work with my userform I have created. Would it be too much to ask to help put this together? It's mostly working but not quite there.

I have a few text unput boxes along with the multiselect list. I can't seem to get them to work together. I got the list working and the text boxes linked to bookmarks but when I add the code you posted to my userform it won't run.

This is what I have on my userform

Code:
Private Sub CommandButton1_Click()
Dim bmdate As Range
Set bmdate = ActiveDocument.Bookmarks("bmdate").Range
bmdate.Text = Me.TextBox1.Value
Dim bmname As Range
Set bmname = ActiveDocument.Bookmarks("bmname").Range
bmname.Text = Me.TextBox3.Value
Dim bmlicense As Range
Set bmlicense = ActiveDocument.Bookmarks("bmlicense").Range
bmlicense.Text = Me.TextBox2.Value
Dim bmaddress As Range
Set bmaddress = ActiveDocument.Bookmarks("bmaddress").Range
bmaddress.Text = Me.TextBox4.Value
Dim bmfname As Range
Set bmfname = ActiveDocument.Bookmarks("bmfname").Range
bmfname.Text = Me.TextBox5.Value
Dim bmcase As Range
Set bmcase = ActiveDocument.Bookmarks("bmcase").Range
bmcase.Text = Me.TextBox6.Value
Dim bminspection As Range
Set bminspection = ActiveDocument.Bookmarks("bminspection").Range
bminspection.Text = Me.TextBox7.Value
Dim bmcdate As Range
Set bmcdate = ActiveDocument.Bookmarks("bmcdate").Range
bmcdate.Text = Me.TextBox8.Value
Dim bmctime As Range
Set bmctime = ActiveDocument.Bookmarks("bmctime").Range
bmctime.Text = Me.TextBox9.Value
Me.Repaint
UserForm1.Hide
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

Private Sub CommandButton1_Click()
Dim i As Long, StrOut As String
For i = 0 To ListBox1.ListCount - 1
  If ListBox1.Selected(i) Then
    StrOut = StrOut & Me.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
Reply With Quote