Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Button not working as expected

Status
Not open for further replies.

hpl2001

Programmer
Dec 18, 2001
105
CA
I have a button on my form that I want to enter some text into a text box field when I press it. The data is stored in a memo field in the table. The code behind the button looks like this:

Me.txtTrackingInfo = "Retrieved: " + Format(Now, "yyyy-mm-dd") + " " + Environ("Username") + vbNewLine + Me.txtTrackingInfo

The first time I press the button no text is put into the field, but every subsequent time I press it the text is entered as expected.

What might cause this?

TIA.

Holly
 
Why are you using "+" rather than "&"? I would try:
Code:
Me.txtTrackingInfo = "Retrieved: " & Format(Now, "yyyy-mm-dd") & " " & Environ("Username") & vbNewLine & Me.txtTrackingInfo

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top