G
Guest
I have a form with five text boxes that are unbound. The first four are
called DescNE, DescNW, DescSW and DescSE.
I am useing the following code to populate the the final field Description.
Where more than one of the short descriptions is filled in I want to insert
the word and between the short descriptions. The problem is that the and's
show up even if there is no adjecent short descriptions. How can I make the
" and " conditional?
Thanks
If Len(Me.DescNE = 0) And Len(Me.DescNW > 0) And Len(Me.DescSW = 0) And
Len(Me.DescSE = 0) Then Me.Description = stDescNW
If Len(Me.DescNE > 0) And Len(Me.DescNW = 0) And Len(Me.DescSW = 0) And
Len(Me.DescSE = 0) Then Me.Description = stDescNE
If Len(Me.DescNE = 0) And Len(Me.DescNW = 0) And Len(Me.DescSW > 0) And
Len(Me.DescSE = 0) Then Me.Description = stDescSW
If Len(Me.DescNE = 0) And Len(Me.DescNW = 0) And Len(Me.DescSW = 0) And
Len(Me.DescSE > 0) Then Me.Description = stDescNE
If Len(Me.DescNE > 0) And Len(Me.DescNW > 0) And Len(Me.DescSW = 0) And
Len(Me.DescSE = 0) Then Me.Description = stDescNE + " " + stDescNW
If Len(Me.DescNE > 0) And Len(Me.DescNW = 0) And Len(Me.DescSW = 0) And
Len(Me.DescSE > 0) Then Me.Description = stDescNE + " " + stDescSE
If Len(Me.DescNE = 0) And Len(Me.DescNW > 0) And Len(Me.DescSW > 0) And
Len(Me.DescSE = 0) Then Me.Description = stDescNW + " " + stDescSW
If Len(Me.DescNE = 0) And Len(Me.DescNW = 0) And Len(Me.DescSW > 0) And
Len(Me.DescSE > 0) Then Me.Description = stDescSE + " " + stDescSW
If Len(Me.DescNE > 0) And Len(Me.DescNW > 0) And Len(Me.DescSW > 0) And
Len(Me.DescSE > 0) Then Me.Description = stDescNE + " and " + stDescNW + "
and " + stDescSW + " and " + stDescSE
called DescNE, DescNW, DescSW and DescSE.
I am useing the following code to populate the the final field Description.
Where more than one of the short descriptions is filled in I want to insert
the word and between the short descriptions. The problem is that the and's
show up even if there is no adjecent short descriptions. How can I make the
" and " conditional?
Thanks
If Len(Me.DescNE = 0) And Len(Me.DescNW > 0) And Len(Me.DescSW = 0) And
Len(Me.DescSE = 0) Then Me.Description = stDescNW
If Len(Me.DescNE > 0) And Len(Me.DescNW = 0) And Len(Me.DescSW = 0) And
Len(Me.DescSE = 0) Then Me.Description = stDescNE
If Len(Me.DescNE = 0) And Len(Me.DescNW = 0) And Len(Me.DescSW > 0) And
Len(Me.DescSE = 0) Then Me.Description = stDescSW
If Len(Me.DescNE = 0) And Len(Me.DescNW = 0) And Len(Me.DescSW = 0) And
Len(Me.DescSE > 0) Then Me.Description = stDescNE
If Len(Me.DescNE > 0) And Len(Me.DescNW > 0) And Len(Me.DescSW = 0) And
Len(Me.DescSE = 0) Then Me.Description = stDescNE + " " + stDescNW
If Len(Me.DescNE > 0) And Len(Me.DescNW = 0) And Len(Me.DescSW = 0) And
Len(Me.DescSE > 0) Then Me.Description = stDescNE + " " + stDescSE
If Len(Me.DescNE = 0) And Len(Me.DescNW > 0) And Len(Me.DescSW > 0) And
Len(Me.DescSE = 0) Then Me.Description = stDescNW + " " + stDescSW
If Len(Me.DescNE = 0) And Len(Me.DescNW = 0) And Len(Me.DescSW > 0) And
Len(Me.DescSE > 0) Then Me.Description = stDescSE + " " + stDescSW
If Len(Me.DescNE > 0) And Len(Me.DescNW > 0) And Len(Me.DescSW > 0) And
Len(Me.DescSE > 0) Then Me.Description = stDescNE + " and " + stDescNW + "
and " + stDescSW + " and " + stDescSE