HI,
I'm trying to format a form with cascading dropdowns. Here are fields:
State
Property name
Property address
The objective is to have the user select the state they are in and then next field will be populated with only the properties in that state. when they select the property only the addresses for that property will show up.
I keep getting an error - "Object required"
I'm not sre what i'm missing, here is the code:
Sub StateList()
If ActiveDocument.FormFields("state").DropDown.Value = 0 Then
ActiveDocument.FormFields("legal").DropDown.ListEntries.Clear
Exit Sub
End If
Select Case ActiveDocument.FormFields("state").Result
Case "NJ"
With ActiveDocument.FormFields("legal").DropDown.ListEntries
.Clear
.Add "legal name"
.Add "legal name 2"
End With
Case "MA"
With ActiveDocument.FormFields("legal").DropDown.ListEntries
.Clear
.Add "legal name 3"
End With
Case "NY"
With ActiveDocument.FormFields("legal").DropDown.ListEntries
.Clear
.Add ""
.Add ""
.Add ""
End With
Case "VA"
With ActiveDocument.FormFields("legal").DropDown.ListEntries
.Clear
.Add ""
.Add ""
.Add ""
End With
End Select
End Sub
Sub LegalList()
If ActiveDocument.FormFields("legal").DropDown.Value = 0 Then
ActiveDocument.FormFields("address").DropDown.ListEntries.Clear
Exit Sub
End If
Select Case ActiveDocument.FormFields("legal").Result
Case "legal name"
With ActiveDocument.FormFields("address").DropDown.ListEntries
.Clear
.Add "55 Main St, USA"
End With
End Select
Select Case ActiveDocument.FormFields("legal").Result
Case "legal name 2"
With ActiveDocument.FormFields("address").DropDown.ListEntries
.Clear
.Add "8200 Main St, USA"
End With
End Select
Select Case ActiveDocument.FormFields("legal").Result
Case "legal name 3"
With ActiveDocument.FormFields("address").DropDown.ListEntries
.Clear
.Add "100 Main St, USA"
.Add "1310 Main St, USA"
End With
End Select
I'm trying to format a form with cascading dropdowns. Here are fields:
State
Property name
Property address
The objective is to have the user select the state they are in and then next field will be populated with only the properties in that state. when they select the property only the addresses for that property will show up.
I keep getting an error - "Object required"
I'm not sre what i'm missing, here is the code:
Sub StateList()
If ActiveDocument.FormFields("state").DropDown.Value = 0 Then
ActiveDocument.FormFields("legal").DropDown.ListEntries.Clear
Exit Sub
End If
Select Case ActiveDocument.FormFields("state").Result
Case "NJ"
With ActiveDocument.FormFields("legal").DropDown.ListEntries
.Clear
.Add "legal name"
.Add "legal name 2"
End With
Case "MA"
With ActiveDocument.FormFields("legal").DropDown.ListEntries
.Clear
.Add "legal name 3"
End With
Case "NY"
With ActiveDocument.FormFields("legal").DropDown.ListEntries
.Clear
.Add ""
.Add ""
.Add ""
End With
Case "VA"
With ActiveDocument.FormFields("legal").DropDown.ListEntries
.Clear
.Add ""
.Add ""
.Add ""
End With
End Select
End Sub
Sub LegalList()
If ActiveDocument.FormFields("legal").DropDown.Value = 0 Then
ActiveDocument.FormFields("address").DropDown.ListEntries.Clear
Exit Sub
End If
Select Case ActiveDocument.FormFields("legal").Result
Case "legal name"
With ActiveDocument.FormFields("address").DropDown.ListEntries
.Clear
.Add "55 Main St, USA"
End With
End Select
Select Case ActiveDocument.FormFields("legal").Result
Case "legal name 2"
With ActiveDocument.FormFields("address").DropDown.ListEntries
.Clear
.Add "8200 Main St, USA"
End With
End Select
Select Case ActiveDocument.FormFields("legal").Result
Case "legal name 3"
With ActiveDocument.FormFields("address").DropDown.ListEntries
.Clear
.Add "100 Main St, USA"
.Add "1310 Main St, USA"
End With
End Select