Missing Data When Printing from new record

J

Jay Myhre

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.
 
S

Steve

It sounds like some of the data you just entered on the data entry form has
not yet been saved when you click the button to print the report. Put te
following code at the beginning of your code in the Click event of the
button:
DoCmd.RunCommand acSave

Steve
(e-mail address removed)
 
J

Jay Myhre

Steve - I failed to mention that I already have the application execute that
line of code in prior to the print function. Thanks for the reply.
 
J

Jay Myhre

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
 
G

Gina Whipp

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 said:
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 said:
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
 
J

Jay Myhre

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 said:
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 said:
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 said:
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

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.
 
G

Gina Whipp

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 said:
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 said:
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 said:
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.



:

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

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.
 
J

Jay Myhre

I just did a review of what isn't printing and many of the "missing" data
elements are from the "parent" table. Only one of the subreports is
printing.
I'm going to try inserting code that when the user clicks on the "Save
Record" button it will close the data entry form and immediately re-open it
and go to the record that was just created and then allow the user to print
the report.

Gina Whipp said:
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 said:
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 said:
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

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.



:

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

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.
 
G

Gina Whipp

Jay,

Adding that button might 'annoy' some people, especially if they have to
click it 15 times. Where is the print button, is it on the Main Form? If
it's a timing issue look up DoEvents this might also work so that it
actually completes saving prior to printing. Another thought, all these
forms are bound to some sort of recordsource correct?

--
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 said:
I just did a review of what isn't printing and many of the "missing" data
elements are from the "parent" table. Only one of the subreports is
printing.
I'm going to try inserting code that when the user clicks on the "Save
Record" button it will close the data entry form and immediately re-open
it
and go to the record that was just created and then allow the user to
print
the report.

Gina Whipp said:
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 said:
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

:

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

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.



:

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

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.
 
J

Jay Myhre

Gina,
I believe I can make it appear seamless and only need to click the Save
Record once and the Print Report once.
All the sub-tables are related to the parent table primary key by a
foreign key.
I'll let you know how this works.

Gina Whipp said:
Jay,

Adding that button might 'annoy' some people, especially if they have to
click it 15 times. Where is the print button, is it on the Main Form? If
it's a timing issue look up DoEvents this might also work so that it
actually completes saving prior to printing. Another thought, all these
forms are bound to some sort of recordsource correct?

--
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 said:
I just did a review of what isn't printing and many of the "missing" data
elements are from the "parent" table. Only one of the subreports is
printing.
I'm going to try inserting code that when the user clicks on the "Save
Record" button it will close the data entry form and immediately re-open
it
and go to the record that was just created and then allow the user to
print
the report.

Gina Whipp said:
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

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

:

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

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.



:

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

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.
 
G

Gina Whipp

Okie dokie...

--
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 said:
Gina,
I believe I can make it appear seamless and only need to click the Save
Record once and the Print Report once.
All the sub-tables are related to the parent table primary key by a
foreign key.
I'll let you know how this works.

Gina Whipp said:
Jay,

Adding that button might 'annoy' some people, especially if they have to
click it 15 times. Where is the print button, is it on the Main Form?
If
it's a timing issue look up DoEvents this might also work so that it
actually completes saving prior to printing. Another thought, all these
forms are bound to some sort of recordsource correct?

--
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 said:
I just did a review of what isn't printing and many of the "missing"
data
elements are from the "parent" table. Only one of the subreports is
printing.
I'm going to try inserting code that when the user clicks on the "Save
Record" button it will close the data entry form and immediately
re-open
it
and go to the record that was just created and then allow the user to
print
the report.

:

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

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

:

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

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.



:

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

message
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.
 
J

Jay Myhre

Gina,
It worked. Just a little polishing up to make it seamless.
Thanks for your help. Sometimes just a voice at the other end give hope
that a solution is just around the corner.
Jay

Gina Whipp said:
Okie dokie...

--
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 said:
Gina,
I believe I can make it appear seamless and only need to click the Save
Record once and the Print Report once.
All the sub-tables are related to the parent table primary key by a
foreign key.
I'll let you know how this works.

Gina Whipp said:
Jay,

Adding that button might 'annoy' some people, especially if they have to
click it 15 times. Where is the print button, is it on the Main Form?
If
it's a timing issue look up DoEvents this might also work so that it
actually completes saving prior to printing. Another thought, all these
forms are bound to some sort of recordsource correct?

--
Gina Whipp

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

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

I just did a review of what isn't printing and many of the "missing"
data
elements are from the "parent" table. Only one of the subreports is
printing.
I'm going to try inserting code that when the user clicks on the "Save
Record" button it will close the data entry form and immediately
re-open
it
and go to the record that was just created and then allow the user to
print
the report.

:

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

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

:

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

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.



:

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

message
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.
 
G

Gina Whipp

Jay,

Glad my voice helped!!!!

--
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 said:
Gina,
It worked. Just a little polishing up to make it seamless.
Thanks for your help. Sometimes just a voice at the other end give hope
that a solution is just around the corner.
Jay

Gina Whipp said:
Okie dokie...

--
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 said:
Gina,
I believe I can make it appear seamless and only need to click the
Save
Record once and the Print Report once.
All the sub-tables are related to the parent table primary key by a
foreign key.
I'll let you know how this works.

:

Jay,

Adding that button might 'annoy' some people, especially if they have
to
click it 15 times. Where is the print button, is it on the Main Form?
If
it's a timing issue look up DoEvents this might also work so that it
actually completes saving prior to printing. Another thought, all
these
forms are bound to some sort of recordsource correct?

--
Gina Whipp

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

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

I just did a review of what isn't printing and many of the "missing"
data
elements are from the "parent" table. Only one of the subreports
is
printing.
I'm going to try inserting code that when the user clicks on the
"Save
Record" button it will close the data entry form and immediately
re-open
it
and go to the record that was just created and then allow the user
to
print
the report.

:

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

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

:

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

message
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.



:

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

message
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top