Go to the next field on a form after running code from previous fi

G

Guest

Hi,

Can any one help me. When I open a form the user must entry information into
same . When it comes to a field I need it to run code which is working fine
my problem is that I want the tab to return to the next field once it has run
the code.

Code attached.

Any thoughts


Thanks
--
Nadine
Private Sub A_C_Exit(Cancel As Integer)
DoCmd.GoToRecord acDataForm, "Frm_Members Details", acNext
DoCmd.GoToRecord acDataForm, "Frm_Members Details", acLast
DoCmd.OpenQuery "Qry_Bank Validation delete temp"
DoCmd.OpenQuery "Qry_Bank Validation test 1"
DoCmd.OpenQuery "Qry_Bank Validation test 2"
If DLookup("FlagBank", "[Tbl_Temp Account Validation]") = 1 Then
DoCmd.OpenQuery "Qry_Bank Validation test 3 90"
DoCmd.OpenQuery "Qry_Bank Validation test 4 90"
DoCmd.OpenQuery "Qry_Bank Validation test 5 90"
DoCmd.OpenQuery "Qry_Bank Validation test 6 90"
DoCmd.OpenQuery "Qry_Bank Validation test 7 90"
DoCmd.OpenQuery "Qry_Bank Validation test 8 90"
DoCmd.Close acQuery, "Qry_Bank Validation test 3 90"
DoCmd.Close acQuery, "Qry_Bank Validation test 4 90"
DoCmd.Close acQuery, "Qry_Bank Validation test 5 90"
DoCmd.Close acQuery, "Qry_Bank Validation test 6 90"
DoCmd.Close acQuery, "Qry_Bank Validation test 7 90"
DoCmd.Close acQuery, "Qry_Bank Validation test 8 90"
DoCmd.OpenForm "Frm_Bank Validation test 9 90"
ElseIf DLookup("FlagBank", "[Tbl_Temp Account Validation]") = 2 Then
DoCmd.OpenQuery "Qry_Bank Validation test 3 93"
DoCmd.OpenQuery "Qry_Bank Validation test 4 93"
DoCmd.OpenQuery "Qry_Bank Validation test 5 93"
'MsgBox "test complete"

Else
MsgBox "test incomplete please check Sort code and bank number"

End If
End Sub
 
R

ruralguy via AccessMonster.com

Use Me.ControlName.SetFocus at the end of your code to put the focus where
ever you want. Using your ControlName of course.
 

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