Results 1 to 4 of 4
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    AppActivate not working as Desired? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    Customer has 5 computers using WinXP Ver 2002 SP2
    1 computer using a2003 (11.6566.8132) SP2
    4 computers using a2003 (11.6566.6568) SP2

    I have an Access Form and when the operator enters a field GotFocus event the following fires:

    AppActivate GetPref("NYS DAM Dog Licensing System Taskbar Name")

    The first time this is run on a computer it loads Login Screen asks for a User Name and Password and the operator continues and process Screen 1 on the internet then clicks back the the Access Form. This works OK.

    The second and subsequence time this is run on same computer, same form different transaction it bypasses Login Screen and the operator process Screen 1 on the internet then clicks back the the Access Form. This works OK.

    On the 1 computer using a2003 (11.6566.8132) SP2

    Going through the above senerio, it asks for the Login Screen each time thus opening multiple tasks for the same website.

    The Task Name is the same on all 5 computers

    Is there a problem with the version of Access on this one computer?

    Is there a setting in Internet Explorer that is not correct thus forcing a new login (new task) each time the URL is selected?

    Thanks, John


    <pre>Private Sub strTranDesc_GotFocus()

    On Error GoTo ErrorHandler

    If GetPref("POS Enter Dog License POS/NYS DAM DLS") Then
    If Me.strTranCode2 = "D" Then
    Select Case Me.strRevCode

    Case "201", "202", "203", "204", "205", "208"

    If Me.NewRecord = False Then ' 0=no New & Renewal, -1=yes Purebred
    DoCmd.RunCommand acCmdCopy 'copies Tran Desc to clip board
    AppActivate GetPref("NYS DAM Dog Licensing System Taskbar Name")
    End If

    End Select

    End If
    End If

    ExitHandler:
    Exit Sub

    ErrorHandler:

    If Err.Number = 5 Then 'run-time error 5, Invalid procedure call or agrument
    Application.FollowHyperlink GetPref("NYS DAM Dog Licensing System"), , True
    Resume Next
    Else
    MsgBox str(Err.Number) & Err.Description
    Resume ExitHandler
    End If

    End Sub
    </pre>


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

    Re: AppActivate not working as Desired? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    What happens if you temporarily comment out the line

    On Error GoTo ErrorHandler

    by inserting an apostrophe in front of it?

  3. #3
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: AppActivate not working as Desired? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    Iím going to have wait to test this on site with problem computer

    My development computer works OK

    When I comment out on my development WinXP Ver 2002 SP2, a2k (9.0.6926) SP-3 Jet 4.0 SP-8 computer I get

    run-time error 5, Invalid procedure call or agrument

    on AppActivate GetPref("NYS DAM Dog Licensing System Taskbar Name")

    Thanks, John

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

    Re: AppActivate not working as Desired? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    That's what I suspected. The AppActivate line throws an error, so your code uses FollowHyperlink to start a new instance of the web page.

    Check carefully on a PC where the problem occurs what the caption is of the window you want to activate. Does it correspond to the result of GetPref(...)?

Posting Permissions

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