Rabu, 26 Maret 2014

[MS_AccessPros] Re: Help with message on openning & closing form

 

Hi John, thanks for the reply.  The message is generated by my application code.  It appears that something is causing the form to get "dirtied" as you indicated.  The form's record source is a table "tblTaxPayer".  Each of the buttons apply a different filter:
    1.     One button selects all taxpayers assigned to the user (logged in)
                      rptFilter = ""
                      rptFilter = "(lngUserID = " & GetLoggedUser() & ")"
                     DoCmd.Close acForm, "frmMainDialog", acSaveNo
                     'DoCmd.OpenForm "frmTaxPayerDialog", acNormal, "", rptFilter
     2. Second button selects all taxpayers in the table (no filter)
                      rptFilter = ""
                      DoCmd.Close acForm, "frmMainDialog", acSaveNo
                     'DoCmd.OpenForm "frmTaxPayerDialog", acNormal, "", rptFilter
     3. Third button selects an individual taxpayer; either by - id, license, or name
The form has a BeforeUpdate event as does each subform associated with the taxpayer form.  The event for taxpayer form is as follows:
================================================
Private Sub Form_BeforeUpdate(Cancel As Integer)
   Dim varTPTID As Variant
   Dim strTPTNo As String

   'If the form data has changed a message is shown asking if
   'the changes should be saved. If the answer is no then
   'the changes are undone
 
   On Error GoTo BeforeUpdate_Error
   If MsgBox("Do you want to save this record?", _
              vbYesNo + vbQuestion, "Save Record") = vbNo Then
         Me.Undo
   Else
      If Me.NewRecord Then
         'Following code ensures that a license is created if one is not supplied
         '  User can update record with new license info when available.
         If IsNull(strTPT) Or strTPT = "" Then
            strTPT = "Unk" & Format(lngTPTID, "000000")
         End If
         TPTID = Me.lngTPTID
         Call AuditChanges(Me, "lngTPTID", "NEW")
      Else
         Call AuditChanges(Me, "lngTPTID", "EDIT")
      End If
   End If

BeforeUpdate_Exit:
   Exit Sub

BeforeUpdate_Error:
   MsgBox Err.Description
   ' Call LogError(Err.Number, Err.Description, "Form_BeforeUpdate()", "Form_frmTaxPayerDialog")
   If Not LogError(Err.Number, Err.Description, "Form_BeforeUpdate()", "Form_frmTaxPayerDialog") Then
      Me.Undo
   End If
   Resume BeforeUpdate_Exit

End Sub

=================================================
My next approach is to visit client, with a copy of the software having some additional code to try and track the  issue.  I.E. the taxpayer form and all subforms with addition text included with the message.
At this point, the system works fine on my computer system (both frontend and backend files contained in same directory).  Hopefully using the clients computer using the network structure will show some additional information.
I will post the outcome following the meeting with the client.
Rod

---In MS_Access_Professionals@yahoogroups.com, <JohnV@...> wrote :

Rod-

Is this a message created by your application code, or is it one generated by the system?  Somehow your form is getting "dirtied" when you try to apply a filter.  What's the code behind one of the filter buttons?

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)




On Mar 26, 2014, at 3:38 AM, desertscroller@... wrote:

Hi All, Not sure I can explain what is happening but here goes.  I have developed an application using Access 2010 that will run on Windows 8.1 and Windows 7.  The issue comes when the application is installed on a Windows 7 system.  The application is split.  Front-end on the user's machine and the back-end is located on a network server.  The users can log into the application will no issues and activate the main dialog.  On the main form are several command buttons of which 3 buttons activate the Taxpayer screen.  Each button applies a different filter.  When the Taxpayer screen is loading a message appears asking the user if he want to update the record.  This same message appears when the screen is closed.  In both cases nothing has changed. My idea is that the network connection is causing the issue.  Reason for this assumption is when the application is executed total from a single machine no issues occur.  Am I missing something or are there an suggestions for further investigation.  I will be going back to the user's site on Thursday and try the assumption on one of the user's system.  Any other suggestions to try would be greatly appreciated.
Rod

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (4)
.

__,_._,___

Tidak ada komentar:

Posting Komentar