Results 1 to 4 of 4

Thread: VB goto code?

  1. #1
    Join Date
    Jan 2003
    Location
    Guelph, Canada
    Posts
    39

    Unanswered: VB goto code?

    Hello,

    I have my focus on my Subform using:

    Private Sub txtMove_GotFocus()
    Me.BethDetentionsSubform.SetFocus
    End Sub


    Could someone please tell me the VB coding required to do the
    following:

    I'd now like to move the cursor to the first empty control in the
    first record.
    Or another way to get to the desired control would make use of this info:

    In the first record,
    If Served = 0 goto DatServ
    = 1 goto DatServ2
    = 2 goto DatServ3

    I'd appreciate knowing the VB code that would make use of either of the two above methods.

    Thanks!

  2. #2
    Join Date
    Aug 2002
    Location
    Charlotte NC
    Posts
    665

    Re: VB goto code?

    Originally posted by Noops
    Hello,

    I have my focus on my Subform using:

    Private Sub txtMove_GotFocus()
    Me.BethDetentionsSubform.SetFocus
    End Sub


    Could someone please tell me the VB coding required to do the
    following:

    I'd now like to move the cursor to the first empty control in the
    first record.
    Or another way to get to the desired control would make use of this info:

    In the first record,
    If Served = 0 goto DatServ
    = 1 goto DatServ2
    = 2 goto DatServ3

    I'd appreciate knowing the VB code that would make use of either of the two above methods.

    Thanks!
    Why not try
    if served = 0 then
    object.setfocus
    elseif served = 1 then
    object.setfoucus
    elseif served = 2 then
    object.setfocus
    end if

    Jim

  3. #3
    Join Date
    Jan 2003
    Location
    Guelph, Canada
    Posts
    39
    Why not try
    if served = 0 then
    object.setfocus
    elseif served = 1 then
    object.setfoucus
    elseif served = 2 then
    object.setfocus
    end if

    Thanks Jim, I'm not sure why it didn't work, but this did:

    If IsNull(Me.BSubform!DatServ) Then
    Me.BSubform!DatServ.SetFocus
    ElseIf IsNull(Me.BSubform!DatServ2) Then
    Me.BSubform!DatServ2.SetFocus
    ElseIf IsNull(Me.BSubform!DatServ3) Then
    Me.BSubform!DatServ3.SetFocus
    End If

  4. #4
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820

    Re: VB goto code?

    Originally posted by JDionne
    Why not try
    if served = 0 then
    object.setfocus
    elseif served = 1 then
    object.setfoucus
    elseif served = 2 then
    object.setfocus
    end if

    Jim
    yuk,
    select case served
    case 0
    object.setfocus
    case 1
    object.setfocus
    case 2
    object.setfocus
    end select
    much more efficent
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

Posting Permissions

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