Use a Check Box to select records to print

Evon

Registered User.
Local time
Today, 15:22
Joined
Apr 1, 2003
Messages
83
I have a form open, but want to print only specific fields in each record. Been trying lots of filtering methods to no avail as I am a novice at filtering.

I can filter records, but cant figure out how to filter specific fields from those records.

My project goes something like this:

Each record in my form consists of listed items like on an invoice. However, not all the items on any given invoice will be printed. Therefore, I set up checkboxes beside each line, so for each invoice, I only tick the items I want to be printed from that invoice. However, I just cannot yet find a way to print the selected items.
 
Why not try a select query using the fields you want to show and a where clause to restrict which records you want. Then use that query as the record source of the report.
 
Thanks jdraw, will try that.
 
Why not try a select query using the fields you want to show and a where clause to restrict which records you want. Then use that query as the record source of the report.

Just realzed, that is how my database is set up right now. So at present, I am getting the records I want.

I now want to be able to print only specific fields from each record. Rember the invoice scenario I outlined in my first post.

So I have an invoice (record). Each item in the invoice consists of fields that would store the following info:

Qty. Unit UnitCost Total
6 ea 500.00 3000.00 Item1
2 ea 200.00 400.00 Item2

So, I only want to print the fields in Item1 and not those of Item2.

Item1 & Item2 are part of a record which would be represented by an Invoice Number.
 
Sorry about the format of the invoice above, the post board isn't keeping the format when I submit the thread, but I hope I was able to convey the info.
 
Okay, found it. Used this in the on open event in the report:

Private Sub Report_Open(Cancel As Integer)

If Forms![Formname]!field.Value = 0 Then
Me.fieldname.Visible = False
Else
Me.fieldname.Visible = True
End If
Sorry, will expand on this in a little while
 
Perhaps you could show us your table(s) design.

I don't know your details, but doesn't this general format seem to fit
Code:
Select fieldIWant1, fieldIWant2,..fieldIWantX from MyTable
WHERE the fieldIamInterestedIn >0....
 
Was just going to add that using a field to select which records to print isn't a good option. In a multi-user environment this method will fail.

What you want to do is use a multi-select listbox and build the WHERE clause from the ItemsSelected collection of the listbox.

I'm not following this thread by the way, just dropped in to say the above :)
 

Users who are viewing this thread

Back
Top Bottom