Printing one address from a form

S

Sadie

Hi,

The quickest way to print one address to an envelope is by using a form.
However if one of the fields is blank it leaves a gap. Is there any way of
not having this gap? Or is there any other way of printing a 'one off'.
 
W

Wayne-I-M

Hi Sadie

Create a new "report" sized the same as your envelope (if you printer will
allow this).

Create a print report button on your form. Somethink like this

DoCmd.OpenReport "rptEnvelope", acViewNormal, "",
"[PrimaryField]=[Forms]![MainForm]![SubForm].[Form]![PrimaryFieldControl]",
acNormal

This assumes your report is called rptEnvelope and that you have a main form
and sub form - if not then it would be something like

DoCmd.OpenReport "rptEnvelope", acViewNormal, "",
"[PrimaryField]=[Forms]![FormName].[Form]![PrimaryFieldControl]", acNormal

Note the PrimaryField is the primary field in the table the form is based on
and the PrimaryFieldControl in the control name of the control that holds
this.


On the report have a text box with some thing like this as the source to get
rid of blank lines.

=[1stName]) & Chr(13)+Chr(10)+[2ndName] & Chr(13)+Chr(10)+[Address1] &
Chr(13)+Chr(10)+[Address2] & Chr(13)+Chr(10)+[Address3] &
Chr(13)+Chr(10)+[Address4]

Of course change the names if you don't have the same from
1stName
2ndName
Address1
Address2
Address3
Address4
etc.
etc


Hope this helps
 
S

Sadie

Hi Wayne

Thanks for replying. Have done that but only get #Name? when printing.
Obviously I have done something wrong. Any ideas?

Wayne-I-M said:
Hi Sadie

Create a new "report" sized the same as your envelope (if you printer will
allow this).

Create a print report button on your form. Somethink like this

DoCmd.OpenReport "rptEnvelope", acViewNormal, "",
"[PrimaryField]=[Forms]![MainForm]![SubForm].[Form]![PrimaryFieldControl]",
acNormal

This assumes your report is called rptEnvelope and that you have a main form
and sub form - if not then it would be something like

DoCmd.OpenReport "rptEnvelope", acViewNormal, "",
"[PrimaryField]=[Forms]![FormName].[Form]![PrimaryFieldControl]", acNormal

Note the PrimaryField is the primary field in the table the form is based on
and the PrimaryFieldControl in the control name of the control that holds
this.


On the report have a text box with some thing like this as the source to get
rid of blank lines.

=[1stName]) & Chr(13)+Chr(10)+[2ndName] & Chr(13)+Chr(10)+[Address1] &
Chr(13)+Chr(10)+[Address2] & Chr(13)+Chr(10)+[Address3] &
Chr(13)+Chr(10)+[Address4]

Of course change the names if you don't have the same from
1stName
2ndName
Address1
Address2
Address3
Address4
etc.
etc


Hope this helps

--
Wayne
Manchester, England.



Sadie said:
Hi,

The quickest way to print one address to an envelope is by using a form.
However if one of the fields is blank it leaves a gap. Is there any way of
not having this gap? Or is there any other way of printing a 'one off'.
 
W

Wayne-I-M

The DB does not recongnise one of the control names you have used.

Check "very carefully" that each name is correct.

"[PrimaryField]=[Forms]![MainForm]![SubForm].[Form]!

Check the name of the Form
Check the name of the control (not the field) in the form that contains the
primary field.



--
Wayne
Manchester, England.



Sadie said:
Hi Wayne

Thanks for replying. Have done that but only get #Name? when printing.
Obviously I have done something wrong. Any ideas?

Wayne-I-M said:
Hi Sadie

Create a new "report" sized the same as your envelope (if you printer will
allow this).

Create a print report button on your form. Somethink like this

DoCmd.OpenReport "rptEnvelope", acViewNormal, "",
"[PrimaryField]=[Forms]![MainForm]![SubForm].[Form]![PrimaryFieldControl]",
acNormal

This assumes your report is called rptEnvelope and that you have a main form
and sub form - if not then it would be something like

DoCmd.OpenReport "rptEnvelope", acViewNormal, "",
"[PrimaryField]=[Forms]![FormName].[Form]![PrimaryFieldControl]", acNormal

Note the PrimaryField is the primary field in the table the form is based on
and the PrimaryFieldControl in the control name of the control that holds
this.


On the report have a text box with some thing like this as the source to get
rid of blank lines.

=[1stName]) & Chr(13)+Chr(10)+[2ndName] & Chr(13)+Chr(10)+[Address1] &
Chr(13)+Chr(10)+[Address2] & Chr(13)+Chr(10)+[Address3] &
Chr(13)+Chr(10)+[Address4]

Of course change the names if you don't have the same from
1stName
2ndName
Address1
Address2
Address3
Address4
etc.
etc


Hope this helps

--
Wayne
Manchester, England.



Sadie said:
Hi,

The quickest way to print one address to an envelope is by using a form.
However if one of the fields is blank it leaves a gap. Is there any way of
not having this gap? Or is there any other way of printing a 'one off'.
 
S

Sadie

Hi Wayne,

I think it might be the Primary Field Control. Where do I find that name?

Sadie

Wayne-I-M said:
The DB does not recongnise one of the control names you have used.

Check "very carefully" that each name is correct.

"[PrimaryField]=[Forms]![MainForm]![SubForm].[Form]!

Check the name of the Form
Check the name of the control (not the field) in the form that contains the
primary field.



--
Wayne
Manchester, England.



Sadie said:
Hi Wayne

Thanks for replying. Have done that but only get #Name? when printing.
Obviously I have done something wrong. Any ideas?

Wayne-I-M said:
Hi Sadie

Create a new "report" sized the same as your envelope (if you printer will
allow this).

Create a print report button on your form. Somethink like this

DoCmd.OpenReport "rptEnvelope", acViewNormal, "",
"[PrimaryField]=[Forms]![MainForm]![SubForm].[Form]![PrimaryFieldControl]",
acNormal

This assumes your report is called rptEnvelope and that you have a main form
and sub form - if not then it would be something like

DoCmd.OpenReport "rptEnvelope", acViewNormal, "",
"[PrimaryField]=[Forms]![FormName].[Form]![PrimaryFieldControl]", acNormal

Note the PrimaryField is the primary field in the table the form is based on
and the PrimaryFieldControl in the control name of the control that holds
this.


On the report have a text box with some thing like this as the source to get
rid of blank lines.

=[1stName]) & Chr(13)+Chr(10)+[2ndName] & Chr(13)+Chr(10)+[Address1] &
Chr(13)+Chr(10)+[Address2] & Chr(13)+Chr(10)+[Address3] &
Chr(13)+Chr(10)+[Address4]

Of course change the names if you don't have the same from
1stName
2ndName
Address1
Address2
Address3
Address4
etc.
etc


Hope this helps

--
Wayne
Manchester, England.



:

Hi,

The quickest way to print one address to an envelope is by using a form.
However if one of the fields is blank it leaves a gap. Is there any way of
not having this gap? Or is there any other way of printing a 'one off'.
 
S

Sadie

Sadie said:
Hi Wayne,

I think it must be the report. Surely a report has to be based on a table or query. If I base this on the table, it will print out all names, not the filtered one shown on the form. Not possible to query the table because there may be many names the same.

Sadie

Wayne-I-M said:
The DB does not recongnise one of the control names you have used.

Check "very carefully" that each name is correct.

"[PrimaryField]=[Forms]![MainForm]![SubForm].[Form]!

Check the name of the Form
Check the name of the control (not the field) in the form that contains the
primary field.



--
Wayne
Manchester, England.



Sadie said:
Hi Wayne

Thanks for replying. Have done that but only get #Name? when printing.
Obviously I have done something wrong. Any ideas?

:

Hi Sadie

Create a new "report" sized the same as your envelope (if you printer will
allow this).

Create a print report button on your form. Somethink like this

DoCmd.OpenReport "rptEnvelope", acViewNormal, "",
"[PrimaryField]=[Forms]![MainForm]![SubForm].[Form]![PrimaryFieldControl]",
acNormal

This assumes your report is called rptEnvelope and that you have a main form
and sub form - if not then it would be something like

DoCmd.OpenReport "rptEnvelope", acViewNormal, "",
"[PrimaryField]=[Forms]![FormName].[Form]![PrimaryFieldControl]", acNormal

Note the PrimaryField is the primary field in the table the form is based on
and the PrimaryFieldControl in the control name of the control that holds
this.


On the report have a text box with some thing like this as the source to get
rid of blank lines.

=[1stName]) & Chr(13)+Chr(10)+[2ndName] & Chr(13)+Chr(10)+[Address1] &
Chr(13)+Chr(10)+[Address2] & Chr(13)+Chr(10)+[Address3] &
Chr(13)+Chr(10)+[Address4]

Of course change the names if you don't have the same from
1stName
2ndName
Address1
Address2
Address3
Address4
etc.
etc


Hope this helps

--
Wayne
Manchester, England.



:

Hi,

The quickest way to print one address to an envelope is by using a form.
However if one of the fields is blank it leaves a gap. Is there any way of
not having this gap? Or is there any other way of printing a 'one off'.
 
Top