simple goto field

G

Guest

Hi
as a excel user I find it difiiicult to write in vb for access as unsure of
how to select items etc I have managed to write following which works well ie
from one form when box_no field = ??corr then it opens form returns and
populates works order and fg code fields my question should be simple how do
i move cursor to reason field on returns form ? in excel i would just write
range("a3").select I tried help but as not sure of termonology so got a bit
lost if also there is a web site for beginners anyone knows i would be
grateful
thanks
Private Sub Box_No_AfterUpdate()

Dim stdocname As String
On Error GoTo MYERR
If Mid(Box_No.Value, 4, 4) = "corr" Or Mid(Box_No.Value, 4, 4) = "CORR" Then
VAR1 = Me.[WORKS ORDER]
VAR2 = Me.[FG Code]
stdocname = "RETURNS"
DoCmd.OpenForm stdocname, , , stLinkCriteria
DoCmd.GoToRecord acDataForm, "RETURNS", acNewRec
Forms(stdocname).[WORK ORDER NO:] = VAR1
Forms(stdocname).[FG CODE:] = VAR2
Else
End If
Exit Sub
MYERR:
MsgBox "YOU MUST ENTER WORKS ORDER AND FG"
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top