Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2005
    Posts
    121

    Unanswered: SetFocus doesn't want to "Set the Focus"

    All,
    Am I missing something here? Per the code below, I am asking the form to check for a duplicate Tote number and if found, clear certain fields, move back to the first data field [1Tote] and then hide and open a warning form. Problem is, it won't move back from [1Seal] to [1Tote], no matter where in the code I place the command. Any suggestions?

    Private Sub Ctl1Tote_AfterUpdate()

    If SkipTestSeals = False Then
    SMLCheck.Value = [1Tote]
    If DCount("[ToteNumber]", "RTVCageSMLCheck", "[ToteNumber]= Forms![RTV Pallet Build]![SMLCheck]") = 0 Then
    [1Tote].Value = Null
    SMLCheck.Value = Null
    [1Tote].SetFocus
    Forms![RTV Pallet Build].Visible = False
    DoCmd.OpenForm "RTV Tote Scan Twice or Not"
    Else
    End If
    Else
    End If

    End Sub

  2. #2
    Join Date
    Oct 2009
    Posts
    340
    make the setfocus as the last task

    the other tasks i.e. docmd.openform - defacto take the focus....

  3. #3
    Join Date
    Dec 2005
    Posts
    121
    Tried that, still doesn't want to move back to that field for some reason. Is there any other command, such as shift/tab that you might use to work around this?

Posting Permissions

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