Re: Missing Data When Printing from new record

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Jay,

Is it a particular dubform and/or set of data that does not get saved? In
that case you MIGHT want to put a Save line on exit of the subform.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"Jay Myhre" <JayMyhre@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:17761B26-DE86-46C2-8D20-5D3F2CA3A725@xxxxxxxxxxxxxxxx
Gina,
I just tried that and no change. I even had my fingers crossed.
I have been writing Access apps since Access 2.0 and have never had this
happen before.
I also just added a separate "Save Record (docmd.runcommand
acCmdSaveRecord)" button to the form. I entered the data, clicked on the
new
Save Record button then clicked on the Print Report button. Still no
change.
I then exit the data entry form, reopen it, go to the same record, and
it
prints perfectly.
Jay

"Gina Whipp" wrote:

Jay,

Move this line...

DoCmd.RunCommand acCmdSaveRecord

.... to right before this line...

DoCmd.OpenReport stDocName, acViewNormal, , "PK_EMSDATASet_PCRNumber = "
&
Forms!fmPCR!PK_EMSDataSet_PCRNumber & ""

....and see if that helps. (My thinking is it might be a timing issue.)
I
have a report that has 10 subreports and all prints well but my save line
is
right before my print report line.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"Jay Myhre" <JayMyhre@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:F1932B85-EEF4-4FFC-A80E-68397775745C@xxxxxxxxxxxxxxxx
Gina,
The following is the code I am using:

-----------------------------------------------------------
Private Sub cmdPrintPCR_Click()
Dim stDocName As String, stLinkCriteria As String

On Error GoTo Err_cmdPrintPCR_Click

DoCmd.RunCommand acCmdSaveRecord

stDocName = "rptPCR"

If EditMode = "EditPCR" Or EditMode = "AddNewPCR" Then
x = Check_For_Complete_PCR() ' Verify that required data has
been
entered on the patient care report

Select Case x
Case 0 ' Found missing required fields
DoCmd.OpenForm "Incomplete PCR Dialog", , , , , acDialog
Exit Sub
Case 1 ' Complete PCR
Forms!fmPCR!Status = "X"
Case 2 ' Other
Dim Msg, Style, Title, Response, myString
Msg = "Do you want to Cancel/Delete this PCR ?" & Chr(10) &
Chr(13) ' Define message.
Msg = Msg & " Click Yes to Delete" & Chr(10) & Chr(13)
Msg = Msg & " Click No to return and complete"

Style = vbYesNo + vbCritical + vbDefaultButton2 ' Define
buttons.
Title = "Type of Call is Missing (IFT, Pt Contact, etc.)"
'
Define title.
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then ' User chose Yes.
Cancel_Add = True
DoCmd.SetWarnings False
strSQL = "DELETE E01_PCRNumber_2.*,
E01_PCRNumber_2.PK_EMSDataSet_PCRNumber,
E01_PCRNumber_2.PCR_Prefix_Number
FROM E01_PCRNumber_2 WHERE (((E01_PCRNumber_2.PK_EMSDataSet_PCRNumber)=
"
&
[Forms]![fmPCR]![PK_EMSDataSet_PCRNumber] & ") AND
((E01_PCRNumber_2.PCR_Prefix_Number)= '" &
[Forms]![fmPCR]![PCR_Prefix_Number] & "'))"
DoCmd.RunSQL strSQL
Me!Status = "Y"
DoCmd.SetWarnings True
Forms!fmLocation!Sequential_Nbr =
Right(DMax("PK_EMSDataSet_PCRNumber", "E01_PCRNumber"), 4) + 1
DoCmd.Close acForm, "fmPCR"
Exit Sub
Else
Exit Sub
End If
End Select
End If

DoCmd.OpenReport stDocName, acViewNormal, , "PK_EMSDATASet_PCRNumber
= "
& Forms!fmPCR!PK_EMSDataSet_PCRNumber & ""



Exit_cmdPrintPCR_Click:
Exit Sub

Err_cmdPrintPCR_Click:
MsgBox Err.Description
Resume Exit_cmdPrintPCR_Click

End Sub
-----------------------------------------------------------------
And yes, there are 15 sub-reports in rptPCR. Each has the proper
Child/Master relationship. Using the same sub routine above it prints
correctly once I have moved away from this record and returned to it.



"Gina Whipp" wrote:

Jay,

Please copy paste the code you are using here. And also confirm, do
you
have 15 subreports?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"Jay Myhre" <JayMyhre@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:17147199-1778-4647-8FD2-F4E5AF93B8D7@xxxxxxxxxxxxxxxx
I am using MS Access 2003. I am creating a database that records
and
prints patient care data. The form has 15 sub-forms which are
needed
to
collect data that can have multiple selections. On the form I have
a
button
that when clicked on will save the data then print a patient care
report
(which also has many sub-reports). The problem is that when
entering
and
printing a new record, not all the data prints. When I exit the
data
entry
form then go back to that record and print, all the data prints.
Is
there
some code I can insert either in the data entry form or the printed
report
that forces the report to wait until all the data has been "loaded"
before
it
prints. Or, is there another problem I'm not thinking of?
P.s. This is basically the same application I previously wrote in
Access
2000 and did not encounter this problem in that database.








.



Relevant Pages

  • Re: Missing Data When Printing from new record
    ... "Gina Whipp" wrote: ... Record once and the Print Report once. ... I then exit the data entry form, reopen it, go to the same record, ... Private Sub cmdPrintPCR_Click ...
    (microsoft.public.access.reports)
  • Re: Missing Data When Printing from new record
    ... Record" button it will close the data entry form and immediately re-open it ... "Gina Whipp" wrote: ... Save Record button then clicked on the Print Report button. ... Private Sub cmdPrintPCR_Click ...
    (microsoft.public.access.reports)
  • Re: Missing Data When Printing from new record
    ... "Gina Whipp" wrote: ... that case you MIGHT want to put a Save line on exit of the subform. ... Save Record button then clicked on the Print Report button. ... Private Sub cmdPrintPCR_Click ...
    (microsoft.public.access.reports)
  • Re: Missing Data When Printing from new record
    ... Save Record button then clicked on the Print Report button. ... "Gina Whipp" wrote: ... Private Sub cmdPrintPCR_Click ... Exit Sub ...
    (microsoft.public.access.reports)
  • RE: Crystal reports
    ... Why not just exit the sub if the user hit cancel. ... When the user chooses a report another ...
    (microsoft.public.dotnet.languages.vb)