T
thomas1388
I am created a form to display addresses. There are 5 fields, street,
street line 2, city , state and zip code. If there is street line 2,
it will become my address line 2, City & ", " * state & zip will
become my address line 3. Since some of the addresses don't have
street line 2, I like to make City & ", " * state & zip as my address
line 2, the address line 3 will become invisible.
After I binded a dataset in the data source window, I dragged a field
into the form, the label control is data-bounced to the field. I have
tried to do the task with the following code:
If lblStreetLine2.Text = String.Empty Then
lblAddressLine2.Text = Trim(lblCity.Text) & ", " & _
Trim(lblState.Text) & " " & lblZip.Text
lblAddressLine3.Text = String.Empty
lblAddressLine3.Visible = False
Else
lblAddressLine2.Text = lblStreetLine2.Text
lblAddressLine3.Text = Trim(lblCity.Text) & ", " & _
Trim(lblState.Text) & " " & lblZip.Text
lblAddressLine3.Visible = true
End If
It didn't work. Can anyone help me? Thank you.
street line 2, city , state and zip code. If there is street line 2,
it will become my address line 2, City & ", " * state & zip will
become my address line 3. Since some of the addresses don't have
street line 2, I like to make City & ", " * state & zip as my address
line 2, the address line 3 will become invisible.
After I binded a dataset in the data source window, I dragged a field
into the form, the label control is data-bounced to the field. I have
tried to do the task with the following code:
If lblStreetLine2.Text = String.Empty Then
lblAddressLine2.Text = Trim(lblCity.Text) & ", " & _
Trim(lblState.Text) & " " & lblZip.Text
lblAddressLine3.Text = String.Empty
lblAddressLine3.Visible = False
Else
lblAddressLine2.Text = lblStreetLine2.Text
lblAddressLine3.Text = Trim(lblCity.Text) & ", " & _
Trim(lblState.Text) & " " & lblZip.Text
lblAddressLine3.Visible = true
End If
It didn't work. Can anyone help me? Thank you.