Results 1 to 7 of 7
  1. #1
    rivereridanus is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Posts
    71

    One user of split db front-end can't launch a form

    Hello everyone,

    I have a very strange problem that I'm having trouble resolving.

    I have a 2007 back-end db on a network share and around 15 regular users who access it through their own front-end db/interface. One user on Windows 7 is able to launch and use his front-end copy fine except when he goes to launch one form for data entry. This form clocks and freezes the entire application. I sat with him and was able to determine that the issue is that the form_load code is never running. He clicks on the button to launch the form (done in vba) and the code never runs. If he opens the form in design view first then changes to form view, the code runs fine and there are no issues. This is his present work-around, but I had to give him an unlocked FE copy to pull it off (not ideal!).

    I tried this with him on different PCs, with different front-end copies, and even in the back-end copy. Same result each time. None of the other users have this issue, and he can replicate this issue on different PCs. I'm at a loss for what might be causing this since it really seems so user-specific.

    Any thoughts on what the issue might be / what I might be able to do to resolve this???

  2. #2
    hapm is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2014
    Posts
    197
    Interesting problem. Newer had something like this. Can you provide the VBA code for the form?

  3. #3
    rivereridanus is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Posts
    71

    Code behind this form

    Not sure if it's a code issue since I can't even get the code to run when he launches the form. When we go in through design view then switch to form view the code runs just fine for him.

    Code:
    Option Compare Database
    Private Sub ChangeType()
        On Error Resume Next
            If Me.Type = "Change" Then
            'If Me.CurrentRecord.[CR/IM Number].length = 6 Then
                'Change Record
                Me.[CR/IM Number_Label].BackColor = Val("&H" & "C0504D")
                Me.Title_Label.BackColor = Val("&H" & "C0504D")
                ShowIncidentChange
                Me.CR_IM_Number.Value = "CR"
            ElseIf Me.Type = "Incident" Then
                'Incident
                Me.[CR/IM Number_Label].BackColor = Val("&H" & "5E83CE")
                Me.Title_Label.BackColor = Val("&H" & "5E83CE")
                ShowIncidentChange
                Me.CR_IM_Number.Value = "IM"
            ElseIf Me.Type = "Case" Then
                'Case
                Me.[CR/IM Number_Label].BackColor = Val("&H" & "826290")
                Me.Title_Label.BackColor = Val("&H" & "826290")
                ShowCase
    '        ElseIf Me.Type = "Maintenance" Then
    '            'Maintenance
    '            Me.[CR/IM Number_Label].BackColor = Val("&H" & "C71585")
    '            Me.Title_Label.BackColor = Val("&H" & "C71585")
    '        ElseIf Me.Type = "Tier3 Maint." Then
    '            'Tier3 Maint.
    '            Me.[CR/IM Number_Label].BackColor = Val("&H" & "2F4F4F")
    '            Me.Title_Label.BackColor = Val("&H" & "2F4F4F")
            Else
                'FYI
                Me.[CR/IM Number_Label].BackColor = Val("&H" & "4EB276")
                Me.Title_Label.BackColor = Val("&H" & "4EB276")
                ShowIncidentChange
            End If
    End Sub
    
    Private Sub btnRefresh_Click()
        Me.tblRelatedRecords_subform.Requery
    End Sub
    Private Sub btnRelate_Click()
        Dim descrip As String
        Dim ID As String
        Dim CRIM As String
        On Error GoTo Err_Handle
        ID = Me.ID
        If Me.Type = "Case" Then
            
            CRIM = Me.[case number].Value
        ElseIf Me.Type = "Incident" Or Me.Type = "Change" Then
            CRIM = Me.CR_IM_Number.Value
        Else:
            MsgBox ("You must enter a CR/IM or Case Number in order to associate other records.")
            Exit Sub
        End If
        DoCmd.OpenForm "frmRelateRecord", acNormal, , , acFormAdd, acDialog, ID + "," + CRIM
        Exit Sub
    Err_Handle:
        MsgBox ("You must enter a CR/IM or Case Number in order to associate other records.")
        Exit Sub
    End Sub
    Private Sub btnExit_Click()
        On Error Resume Next
        Dim idnum As String
        idnum = Me.ID
        
        DoCmd.SetWarnings False
        DoCmd.Close acForm, "frmIssueDataEntry", acSaveNo
        DoCmd.RunSQL ("DELETE * FROM Issues WHERE ID=" + idnum)
        'will cascade delete timestamps
        
        DoCmd.SetWarnings True
    End Sub
    Private Sub btnSubmit_Click()
        'check that all fields are okay
        If CheckFields = True Then
            'Me.[Opened By] = Environ("username")
            DoCmd.RunCommand acCmdSaveRecord
            DoCmd.Close acForm, "frmIssueDataEntry", acSaveNo
        Else:
            MsgBox ("Please fill out all required fields (boxed in red) before submitting.")
            Exit Sub
        End If
    End Sub
    
    Private Sub case_number_AfterUpdate()
        If Not Me.case_number.Value & "" = "" Then
            Dim strCRIM As String
            strCRIM = "[case number] = '" + Me.case_number.Value + "'"
            'strCRIM = DLookup("[CR/IM Number]", "[Issues]", Not "[CR/IM Number]=" + Me.CR_IM_Number.Value & "")
            'Dim numCRIM As Integer
            numCRIM = DCount("ID", "Issues", strCRIM)
            If Not (numCRIM = 0) Then
                MsgBox ("This case number is already in use. Please use the existing record instead of creating a new one.")
                Me.case_number.Value = ""
            End If
        End If
    End Sub
    Private Sub Combo431_Change()
                If Not (Me.Combo431.Value = "" Or Me.Combo431.Value = "--None--") Then
                    Me.FollowUpReason.BorderColor = Val("&H" & "000CC")
                    Me.FollowUpReason.BorderWidth = 1
                Else:
                    Me.FollowUpReason.BorderColor = Val("&H" & "CCC8C2")
                    Me.FollowUpReason.BorderWidth = 0
                End If
    End Sub
    Private Sub CR_IM_Number_AfterUpdate()
    If Not Me.CR_IM_Number.Value & "" = "" Then
            Dim strCRIM As String
            strCRIM = "[CR/IM Number] = '" + Me.CR_IM_Number.Value + "'"
            'strCRIM = DLookup("[CR/IM Number]", "[Issues]", Not "[CR/IM Number]=" + Me.CR_IM_Number.Value & "")
            'Dim numCRIM As Integer
            numCRIM = DCount("ID", "Issues", strCRIM)
            If Not (numCRIM = 0) Then
                MsgBox ("This CR/IM number is already in use. Please use the existing record instead of creating a new one.")
                Me.CR_IM_Number.Value = ""
            End If
        End If
    End Sub
    
    Private Sub CR_IM_Number_Click()
        Me.CR_IM_Number.SelStart = 3
    End Sub
    Private Sub CR_IM_Number_GotFocus()
        Me.CR_IM_Number.SelStart = 3
    End Sub
    Private Sub Form_Load()
        'auto set day/night flag at 6am/6pm
        Dim valTime As Date
        valTime = TimeValue(Now)
        If valTime > TimeValue("06:00:00") And valTime < TimeValue("18:00:00") Then
            'same-day Daytime
            Me.day = True
            Me.Opened_Date = Date
            Me.touch_date = Date
        ElseIf valTime > TimeValue("18:00:00") And valTime < TimeValue("23:59:59") Then
            'same-day Nighttime
            Me.Opened_Date = Date
            Me.touch_date = Date
            Me.night = True
        Else: 'between 0:00:00 and 6:00:00 AM
            'yesterday Nighttime
            Dim yesterday As Date
            yesterday = Date - 1
            Me.night = True
            Me.Opened_Date = yesterday
            Me.touch_date = yesterday
        End If
    End Sub
        
    Private Sub Type_AfterUpdate()
        ChangeType
    End Sub
    Private Sub Type_Change()
        ChangeType
    End Sub
    Private Sub ShowIncidentChange()
        Me.Label454.Visible = False
        Me.server.Visible = False
        Me.Combo459_Label.Visible = False
        Me.Combo459.Visible = False
        Me.Label455.Visible = False
        Me.case_number.Visible = False
        Me.Combo461.Visible = False
        Me.Label456.Visible = False
        Me.Label465.Visible = False
        Me.Label466.Visible = False
        Me.Label467.Visible = False
        Me.Label464.Visible = False
        
        Me.Category.Visible = True
        Me.Label449.Visible = True
        Me.Combo435.Visible = True
        Me.Label405.Visible = True
        Me.PR_Number.Visible = True
        Me.Label410.Visible = True
        
        Me.CR_IM_Number.Enabled = True
    End Sub
    Private Sub ShowCase()
        
        Me.Label454.Visible = True
        Me.server.Visible = True
        Me.Combo459_Label.Visible = True
        Me.Combo459.Visible = True
        Me.Label455.Visible = True
        Me.case_number.Visible = True
        Me.Combo461.Visible = True
        Me.Label456.Visible = True
        Me.Label465.Visible = True
        Me.Label466.Visible = True
        Me.Label467.Visible = True
        Me.Label464.Visible = True
        
        Me.Category.Visible = False
        Me.Label449.Visible = False
        Me.Combo435.Visible = False
        Me.Label405.Visible = False
        Me.PR_Number.Visible = False
        Me.Label410.Visible = False
        Me.CR_IM_Number.Value = ""
        Me.CR_IM_Number.Enabled = False
    End Sub
    Private Function CheckFields() As Boolean
        CheckFields = False
        If Not (Me.Title.Value & "" = "") Then
            If Not (Me.Combo440.Value & "" = "") Then
                If Not (Me.Type.Value & "" = "") Then
                    'If Not (Me.CR_IM_Number.Value & "" = "") Or Not (Me.case_number.Value & "" = "") Then
                        If (Me.day.Value = True Or Me.night = True) Then
                            If CheckTier3FollowUp = True Then
                                If Me.Type & "" = "Case" Then
                                    If Not (Me.server & "" = "") Then
                                        If Not (Me.[Case Status] & "" = "") Then
                                            If Not (Me.case_number & "" = "") Then
                                                If Not (Me.Vendor & "" = "") Then
                                                    CheckFields = True
                                                End If
                                            End If
                                        End If
                                    End If
                                Else: CheckFields = True
                                End If
                            End If
                        End If
                    'End If
                End If
            End If
        End If
    End Function
    Private Function CheckTier3FollowUp()
        If Not (Me.Tier3_request & "" = "") Then
            If Not (Me.FollowUpReason & "" = "") Then
                 'pass
                 CheckTier3FollowUp = True
            Else: 'fail
                CheckTier3FollowUp = False
            End If
        Else: 'pass
            CheckTier3FollowUp = True
        End If
    End Function

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    It sounds as though this individual is cursed. If he is not cursed, there must be something else that distinguishes this individual. Perhaps Users have credentials that cause your app to behave a certain way.

    Isolate what distinguishes this individual and replicate that in a test environment. Then start commented out code.

  5. #5
    rivereridanus is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Posts
    71
    Quote Originally Posted by ItsMe View Post
    It sounds as though this individual is cursed.
    I think you must be right! I'll keep working at it and update this thread when I figure it out. Thanks!

  6. #6
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Does the form open and display before freezing?

    What is the code behind the button that launches the form?

  7. #7
    rivereridanus is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Posts
    71

    Form launch code

    This is the code on a different form that launches the data entry form.

    Code:
    Private Sub btnNew_Click()
        'open form in data enter mode to create new record
        DoCmd.OpenForm "frmIssueDataEntry", acNormal, , , acFormAdd, acDialog
    End Sub

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Split DB Question - Multi User Environment Launch
    By aussie92 in forum Database Design
    Replies: 6
    Last Post: 01-22-2014, 03:19 PM
  2. Replies: 3
    Last Post: 09-27-2013, 07:56 AM
  3. front end code with user form
    By gammaman in forum Programming
    Replies: 1
    Last Post: 07-19-2013, 02:39 PM
  4. Replies: 1
    Last Post: 04-10-2013, 09:16 AM
  5. Replies: 0
    Last Post: 01-18-2007, 07:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums