Fill text box

  • Thread starter Thread starter Rick
  • Start date Start date
R

Rick

Okay, heres what I'd like to do. I have a text box that I
want to put the letter D in but only if Field (answer D)
has something in it. If field (answer D) is blank then I
want the text box to be blank also. Can anyone help me?

Thanks Rick
 
Okay, heres what I'd like to do. I have a text box that I
want to put the letter D in but only if Field (answer D)
has something in it. If field (answer D) is blank then I
want the text box to be blank also. Can anyone help me?

I'm not sure what you mean, here. If you assign the value of a field to a text
box and the field is empty (or Null), you should get an empty text box. The
following, however, will only assign the value under the condition you specified
(using the Len() approach also accommodates zero-length values):

'***
If Len(Me.[answer D].Value & vbNullString) > 0 Then
Me.MyTextboxName.Value = Me.[answer D].Value
End If
'***

You will need to replace the above field and textbox names with names
appropriate to your project.
 
Back
Top