Hi, Marv.
Try something like the following:
X = 4
SendKeys "{DOWN " & X & "}", False ' Move down to 4th row.
Or if you want to use a loop that may terminate early depending upon a
certain criteria, try:
For idx = 0 To (X - 1)
SendKeys "{DOWN}", False ' Move down to next row.
If (certain_criteria) Then
Exit For
End If
Next idx
HTH.
Gunny
See
http://www.QBuilt.com for all your database needs.
See
http://www.Access.QBuilt.com for Microsoft Access tips.
(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
- - -
When you see correct answers to your question, please sign in to Microsoft's
Online Community and mark these posts, so that all may benefit by filtering
on "Answered questions" and quickly finding the right answers to similar
questions.
"Marv Keane" wrote:
> I am trying to use the following sendkeys command to step down a variable
> number of lines:
>
> SendKeys "{DOWN X}", True ' MOVE DOWN X NUMBER OF RECORDS OR LINES
>
> I am getting an error. What's the correct syntax if I need to use a variable?
>
> Thanks in advance.