Insert a string at end of data already stored in a textbox

L

Lorraine

When a date is entered in the txtCompDate field I would like the string
"water quality ok" to be appended at the end of any text already stored in
the txtComments field. Can this be accomplished?

Private Sub txtCompDate_AfterUpdate()

If Not IsNull(CompDate) Then
Me.txtComments = "Water quality ok" 'Here is where I need additional code
End If

End Sub
 
D

Duane Hookom

Private Sub txtCompDate_AfterUpdate()

If Not IsNull(CompDate) Then
Me.txtComments = Me.txtComments & " Water quality ok"
End If

End Sub
 
F

freakazeud

Hi,
try:

If Not IsNull(CompDate) Then
Me.txtComments = Me.txtComments & " Water quality ok"
End If

HTH
Good luck
 
D

Dirk Goldgar

Lorraine said:
When a date is entered in the txtCompDate field I would like the
string "water quality ok" to be appended at the end of any text
already stored in the txtComments field. Can this be accomplished?

Private Sub txtCompDate_AfterUpdate()

If Not IsNull(CompDate) Then
Me.txtComments = "Water quality ok" 'Here is where I need
additional code End If

End Sub

Me.txtComments = Me.txtComments & "Water quality ok"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top