Hi,
I have to process a number of controls and I want to have the code defined just once.
So I have this piece of code. Problem is, I get 'invalid use of null on the 'Len' statement.
If I replace it with say 50, the code works fine.
I tried this out in access 2000 using len(me!text0) (text0 being the actual field name), but when I tried it in 97 (in order to try and find the error), that wouldn't work either !!
This should be so simple - it's driving me nuts.
Private Sub Process_MouseMove(ctl_name)
Dim txtname As String
Dim i As Integer
Dim x As Long
txtname = "txt" & mID(ctl_name, 4)
Me(txtname).SetFocus
Me(txtname).SelStart = 0
Me(txtname).SelLength = 0
For i = 1 To Len(Me(txtname))
Me(txtname).SelStart = Me(txtname).SelStart + 1
For x = 1 To 750000
Next x
Next
End Sub
If you're wondering what the code is trying to achieve - it's a scrolling textbox.
thanks.
Regards,
Graham
I have to process a number of controls and I want to have the code defined just once.
So I have this piece of code. Problem is, I get 'invalid use of null on the 'Len' statement.
If I replace it with say 50, the code works fine.
I tried this out in access 2000 using len(me!text0) (text0 being the actual field name), but when I tried it in 97 (in order to try and find the error), that wouldn't work either !!
This should be so simple - it's driving me nuts.
Private Sub Process_MouseMove(ctl_name)
Dim txtname As String
Dim i As Integer
Dim x As Long
txtname = "txt" & mID(ctl_name, 4)
Me(txtname).SetFocus
Me(txtname).SelStart = 0
Me(txtname).SelLength = 0
For i = 1 To Len(Me(txtname))
Me(txtname).SelStart = Me(txtname).SelStart + 1
For x = 1 To 750000
Next x
Next
End Sub
If you're wondering what the code is trying to achieve - it's a scrolling textbox.
thanks.
Regards,
Graham