Bruce,
I have inherited a small system that was designed by someone who left no
documentation and is no longer contactable.
The data that is displayed incorrectly is either shown as a null field or
the value last entered in that field on the screen is shown (i.e. if a new
was created or record was changed, then whatever was last entered on the
screen on the form in this field, then this value is displayed for all
records). NOTE - it is only display that is incorrect - the database
remains
correct. All fields concerned are Unbound fields that exist on other
tables,
except one field that exists on the table the form is based upon and is
displayed as a combo box.
The custom ''previous record'' button has the following code :-
Private Sub cmdcalldetailprevious_Click()
On Error GoTo Err_cmdcalldetailprevious_Click
DoCmd.GoToRecord , , acPrevious
Me.Refresh
Exit_cmdcalldetailprevious_Click:
Exit Sub
Err_cmdcalldetailprevious_Click:
Select Case Err.Number
Case Is = 2105
Exit Sub
Case Else
MsgBox Err.Description
Resume Exit_cmdcalldetailprevious_Click
End Select
End Sub
The ''Next Button'' is exactly the same except that word previous is
replaced with the word next.
The custom print button is supposed to print of a report version of the
form
where the code is as follows :-
Private Sub cmdPrintCallDetail_Click()
On Error GoTo Err_cmdPrintCallDetail_Click
Dim stDocName As String
stDocName = "rptCallDetails"
DoCmd.OpenReport stDocName, acViewPreview, ,
"[ID]=[Forms]![frmMain]![ID]"
Exit_cmdPrintCallDetail_Click:
Exit Sub
Err_cmdPrintCallDetail_Click:
MsgBox Err.Description
Resume Exit_cmdPrintCallDetail_Click
End Sub
Would I be correct in thinking thta if the Form error is resolved, this
would then be reflected in the print function too?
FYI - if I take the Print Function from the tool bar then every record is
printed, and again the fields mentioned before are incorrect.
I hope this answers all your questions and provides more clarification to
my
problem.
Your help is greatly appreciated,
regards,
C. Stanton
BruceM said:
Are you referring to the record navigation buttons at the bottom of the
form
next to the record counter? In what way is the data incorrect? What is
the
code behind the custom buttons? Did you use a wizard to create the Print
button? What does it do, and what are you expecting instead? What is
the
code behind the Print button?