T
tim johnson
I have a listbox named lstDisplay on a form. When I
click the list box the following procedure is executed
that populates an unbound textbox named txtDisplay on the
same form.
Private Sub lstDisplay_Click()
strSQL = "SELECT CommentDate, Comments FROM
tblCustomerComments " & _
"WHERE CustomerCommentsID = " & lstDisplay
Set rst = New ADODB.Recordset
Set cnn = CurrentProject.Connection
rst.Open strSQL, cnn, adOpenKeyset, , adCmdText
txtDisplay = rst!CommentDate & ": " & rst!Comments
rst.Close
Set rst = Nothing
End Sub
You notice I am concatanating 2 fields from
tblCustomerComments, CommentDate and Comments then
displaying them in the unbound control, txtDisplay.
If the comments are long then I have to scroll to read
all the comments. The problem am having is that if I
click in txtDisplay in an attempt to scroll the data in
txtDisplay disappears.
It seems that beacuse txtDisplay is poputated by code
clicking in this txtBox after it is populated cause the
values to disappear when the txtDisplay gets focus.
How can I get areound this.
click the list box the following procedure is executed
that populates an unbound textbox named txtDisplay on the
same form.
Private Sub lstDisplay_Click()
strSQL = "SELECT CommentDate, Comments FROM
tblCustomerComments " & _
"WHERE CustomerCommentsID = " & lstDisplay
Set rst = New ADODB.Recordset
Set cnn = CurrentProject.Connection
rst.Open strSQL, cnn, adOpenKeyset, , adCmdText
txtDisplay = rst!CommentDate & ": " & rst!Comments
rst.Close
Set rst = Nothing
End Sub
You notice I am concatanating 2 fields from
tblCustomerComments, CommentDate and Comments then
displaying them in the unbound control, txtDisplay.
If the comments are long then I have to scroll to read
all the comments. The problem am having is that if I
click in txtDisplay in an attempt to scroll the data in
txtDisplay disappears.
It seems that beacuse txtDisplay is poputated by code
clicking in this txtBox after it is populated cause the
values to disappear when the txtDisplay gets focus.
How can I get areound this.