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

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » AppActivate not working as Desired? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    Author
    Topic
    #445765

    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

    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 
    
    Viewing 0 reply threads
    Author
    Replies
    • #1081732

      What happens if you temporarily comment out the line

      On Error GoTo ErrorHandler

      by inserting an apostrophe in front of it?

      • #1081747

        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

        • #1081756

          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(…)?

    Viewing 0 reply threads
    Reply To: AppActivate not working as Desired? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: