Problem with Sendmessage

D

Deb Taylor

I have a form in a Access 2003 database which contains a testbox. I'm trying
to pull one line of data at a time from the textbox. The following is a
snipit of code I'm using:

Dim lCount As Long, l As Long, i As Integer, k As Long, a$

Forms!frmovertest!Text3.SetFocus
hwnd = apiGetFocus()
lCount = SendMessageAsLong(Wnd, EM_GETLINECOUNT, 0, ByVal 0)
If lCount = 0 Then MsgBox "No lines!": Exit Function
ReDim aLines(1 To lCount) As String
i = 512
a$ = Space$(512)
For l = 0 To lCount - 1
Call CopyMemory(ByVal a$, i, 2)
k = SendMessage(hwnd, EM_GETLINE, l, ByVal a$)
aLines(l + 1) = Left$(a$, k)
MsgBox aLines(l + 1)
Next

The Sendmessage statement doing the linecount is returning 0. I can not
figure out how to send the correct control handle to the sendmessage
function.
 
Top