I'm wondering if I can take the below code and condense it in some way?
This works for what I need it to do, but in my quest to learn more about vba, I'm wondering if there is a better/more code condensed format.
Code:
Dim Doc As String
If Me.cbLnDoc.Text = "Loan Agreement" Then
Doc = "LA"
End If
If Me.cbLnDoc.Text = "Asset Summary Report" Then
Doc = "ASR"
End If
If Me.cbLnDoc.Text = "Assignment of Leases & Rents" Then
Doc = "ALR"
End If
If Me.cbLnDoc.Text = "Assignment of Mortgage" Then
Doc = "AOM"
End If
If Me.cbLnDoc.Text = "Cash Management Agreement" Then
Doc = "CMA"
End If
If Me.cbLnDoc.Text = "Comfort/Franchise Agr. (Lodging Only)" Then
Doc = "FA"
End If
If Me.cbLnDoc.Text = "Deed of Trust" Then
Doc = "DOT"
End If
If Me.cbLnDoc.Text = "Environmental Indemnity Agreement" Then
Doc = "EIA"
End If
If Me.cbLnDoc.Text = "Escrow Agreement" Then
Doc = "EA"
End If
If Me.cbLnDoc.Text = "Guaranty Agreement" Then
Doc = "GA"
End If
If Me.cbLnDoc.Text = "Management Agreement" Then
Doc = "MA"
End If
If Me.cbLnDoc.Text = "Other; Please Describe" Then
Doc = "_"
End If
If Me.cbLnDoc.Text = "Post Closing Letter/Agreement" Then
Doc = "PCA"
End If
If Me.cbLnDoc.Text = "Promissory Note" Then
Doc = "Note"
End If
If Me.cbLnDoc.Text = "Reserve Agreement" Then
Doc = "RA"
End If
If Me.cbLnDoc.Text = "Side Letter" Then
Doc = "SLTR"
End If
This works for what I need it to do, but in my quest to learn more about vba, I'm wondering if there is a better/more code condensed format.