report prints blank fields

  • Thread starter Thread starter Joanne
  • Start date Start date
J

Joanne

I am trying to print out the current record that is in my form, but
all that prints is a blank form. I have tried to do this using both
of the following coding snippets - same blank form result for both.

Private Sub cmdPrintPhoneOrder_Click()
DoCmd.OpenReport "rptPhoneOrders", , , "[CoNameID] = " & Me!CoNameID
End Sub

Private Sub cmdPrintPhoneOrder_Click()
Dim strDocName As String
Dim strWhere As String
strDocName = "rptPhoneOrders"
strWhere = "[CoNameID]=" & Me!CoNameID
DoCmd.OpenReport strDocName, acNormal, , strWhere
End Sub

This form is based on 4 simple tables to get the info into the
cboboxes. Once there, I want to print it, dump the info, and do the
next one. That's all the app is needed for, but I am wondering if
since I am not writing the fields to a table if this is why the report
is always empty?
If that is the case, how do I write the info to some holding table
without messing with the rowsource information that fills my cboboxes?

The record can be dumped after print, so the holding table will only
ever have one record in it at a time, which I'm thinking will solve
the problem of printing only the current record.

Thanks for any help you can give me - I appreceiate your efforts.

Joanne
 
Joanne,
Not sure if I understand but...
Are you saying that you have 4 "unbound" combo boxes on a form, and you want a report
to display/print those 4 values?

Any "bound" fields on the form can be accessed by the report through the query behind
it.
But unbound combos values will need to be directly referred to...

Leaving the form open while the report is called... an unbound text control with a
ControlSource of...
= Forms!frmYourCallingFormName!cboYourComboName
would display the value presently selected in cboYourComboName of the form.
Same for the other 3 combos.
 
Thanks a million Al. I put the criteria in the control source for each
control on the report and it prints just as I wanted.
 
Back
Top