Re: Missing Data When Printing from new record
- From: "Gina Whipp" <NotInterested@xxxxxxxxxxxxx>
- Date: Wed, 2 Sep 2009 21:35:52 -0400
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.
.
- Follow-Ups:
- Re: Missing Data When Printing from new record
- From: Jay Myhre
- Re: Missing Data When Printing from new record
- References:
- Missing Data When Printing from new record
- From: Jay Myhre
- Re: Missing Data When Printing from new record
- From: Gina Whipp
- Re: Missing Data When Printing from new record
- From: Jay Myhre
- Re: Missing Data When Printing from new record
- From: Gina Whipp
- Re: Missing Data When Printing from new record
- From: Jay Myhre
- Missing Data When Printing from new record
- Prev by Date: Re: Missing Data When Printing from new record
- Next by Date: Re: Missing Data When Printing from new record
- Previous by thread: Re: Missing Data When Printing from new record
- Next by thread: Re: Missing Data When Printing from new record
- Index(es):
Relevant Pages
|