Harald Borchard said:
I used the SendKey ^" function to insert data from previous record as I
enter that field.
How do I convert that function to VB code?
Here's an example from an old help file:
This example uses the Shell function to run the Calculator application
included with Microsoft Windows.It uses the SendKeys statement to send
keystrokes to add some numbers, and then quit the Calculator. The SendKeys
statement is not available on the Macintosh. (To see the example, paste it
into a procedure, then run the procedure. Because AppActivate changes the
focus to the Calculator application, you can't single step through the
code.)
Dim ReturnValue As Variant
Dim i As Integer
ReturnValue = Shell("CALC.EXE", 1) ' Run Calculator.
AppActivate ReturnValue ' Activate the Calculator.
For I = 1 To 100 ' Set up counting loop.
SendKeys i & "{+}", True ' Send keystrokes to Calculator
Next i ' to add each value of i.
SendKeys "=", True ' Get grand total.
SendKeys "%{F4}", True ' Send ALT+F4 to close Calculator.