Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Oct 2002
    Location
    Sayre, Pennsylvania, USA
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Proper VBA Syntax (2000)

    Hi,
    I'm trying to write code (very much a novice) so when I tab out of one control it goes to another. The first control is in the form header and the next one is in the detail area. This is the code I'm using:

    Private Sub cboVendorSelect_Exit(Cancel As Integer)
    DoCmd.GoToControl [dtmDatePartOrdered]
    End Sub

    But it won't work, i'm know I'm not using the syntax correct.
    Thanks,
    Deb

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Proper VBA Syntax (2000)

    You must use the name of the control; this is a string:

    DoCmd.GoToControl "dtmDatePartOrdered"

    or, alternatively, use the SetFocus method of the control itself:

    Me.dtmDatePartOrdered.SetFocus

  3. #3
    4 Star Lounger
    Join Date
    Oct 2002
    Location
    Sayre, Pennsylvania, USA
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Proper VBA Syntax (2000)

    Thanks, worked great!
    Deb

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •