Would someone please explain this to me

  • Thread starter Thread starter richard
  • Start date Start date
R

richard

In the A2007 Time and Billing template, you can print an (envelope) report
using the projects details form. The where condition is ="[ProjectID]=" &
[ID], right?

So...how does that work?

When I try to duplicate that same (envelope) report using customer details
form, or even under the employee details form, I don't know what to put under
'where condition'??

Am I even making sense?

I'm trying to print envelopes for customers and employees as well. But when
I duplicate the envelope (and make some minor tweaks), it won't retreive the
record I pick from the form, I don't know enough about macros to make it work.

Anybody?

Thanks.
 
Actually, I said some things that aren't true. You can't print an envelope
in that template - I made an envelope out of the invoice, in other words,
copied the invoice, renamed it "envelope", took out everything I didn't need,
pasted another print invoice button and renamed it, (because I wouldn't know
how to build something like this in the first place). But it got a little
trickier for me when I wanted to print envelopes from the customer and
employee details forms.

Anyways...
 
Hi Richard

I made a small asset database a while back and had to print envelopes this
is what I used behind the my print button:


Private Sub Command44_Click()
On Error GoTo Err_Command44_Click

Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[eqtagid] = " & Me.[EqtagID]
DoCmd.OpenReport "rptEnvelope", acViewNormal, , strWhere 'Prints
envelope

PurchaseOrder.SetFocus

End If
Exit_Command44_Click:
Exit Sub

Err_Command44_Click:
MsgBox err.Description
Resume Exit_Command44_Click

End Sub

Remember your printing off the main form not the subform. I like this code
because your looking at the record that will be printed. The down side is you
cant batch them together.

Good luck
Richard E




richard said:
Actually, I said some things that aren't true. You can't print an envelope
in that template - I made an envelope out of the invoice, in other words,
copied the invoice, renamed it "envelope", took out everything I didn't need,
pasted another print invoice button and renamed it, (because I wouldn't know
how to build something like this in the first place). But it got a little
trickier for me when I wanted to print envelopes from the customer and
employee details forms.

Anyways...

richard said:
In the A2007 Time and Billing template, you can print an (envelope) report
using the projects details form. The where condition is ="[ProjectID]=" &
[ID], right?

So...how does that work?

When I try to duplicate that same (envelope) report using customer details
form, or even under the employee details form, I don't know what to put under
'where condition'??

Am I even making sense?

I'm trying to print envelopes for customers and employees as well. But when
I duplicate the envelope (and make some minor tweaks), it won't retreive the
record I pick from the form, I don't know enough about macros to make it work.

Anybody?

Thanks.
 
richard,

There are two ways to set the linking criteria in Access depending on which
data type you are using, i.e., text or a number. For text, you need double
quotes around a single quote like this:

= "[TextField]=" & "'" & Me![TextField] & "'"

For numbers, I believe you leave the "'" and the second & out of your
expression. If you have Access 2003, it will insert the correct
stLinkCriteria in a click event for you.

Here's a snippet from a module that works. I copied it originally from an
Access 2003 Click Event into an Access 2007 app:

----
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "rptResumes"

stLinkCriteria = "[FullName]=" & "'" & Me![FullName] & "'"
DoCmd.OpenReport stDocName, acViewPreview, , stLinkCriteria
----

HTH

David

richard said:
Actually, I said some things that aren't true. You can't print an envelope
in that template - I made an envelope out of the invoice, in other words,
copied the invoice, renamed it "envelope", took out everything I didn't need,
pasted another print invoice button and renamed it, (because I wouldn't know
how to build something like this in the first place). But it got a little
trickier for me when I wanted to print envelopes from the customer and
employee details forms.

Anyways...

richard said:
In the A2007 Time and Billing template, you can print an (envelope) report
using the projects details form. The where condition is ="[ProjectID]=" &
[ID], right?

So...how does that work?

When I try to duplicate that same (envelope) report using customer details
form, or even under the employee details form, I don't know what to put under
'where condition'??

Am I even making sense?

I'm trying to print envelopes for customers and employees as well. But when
I duplicate the envelope (and make some minor tweaks), it won't retreive the
record I pick from the form, I don't know enough about macros to make it work.

Anybody?

Thanks.
 
Back
Top