Copying from two forms

D

Dudley

I am trying to copy from two forms to a third one with code

Dim stdocname As String
Dim stlinkcriteria As String

stdocname = "MemoForm"
stlinkcriteria = "[EnvelopeNumber]=" & Me![EnvelopeNumber]
DoCmd.OpenForm "MemoForm", , , stlinkcriteria
[Forms]!MemoForm.EnvelopeNumber = Me.EnvelopeNumber
[Forms]!MemoForm.CompanyFullName = Me.CompanyName & " " & Me.LIMITED
DoCmd.OpenForm "SubscriberSubForm", , , stlinkcriteria
[Forms]!MemoForm.Subscriber1 = [Forms]!SubscriberSubForm.Forenames & " "
& [Forms]!SubscriberSubForm.Surname

Copying from the open form works, but the last line to copy from a third
form gives error 'Application or object defined error'. How can I do this?

Thanks
Dudley
 
D

Douglas J. Steele

The name implies that SubscriberSubForm is a subform. If that's the case, be
aware that subforms are not added to the Forms collection: they're not
"open" in the traditional sense. You have to refer to them via the form on
which they're hosted. See http://www.mvps.org/access/forms/frm0031.htm for a
good reference on how to do that.

Be aware that, depending on how the form is added as a subform, the name of
the subform control may not be the same as the name of the form being used
as a subform. Make sure you're using the name of the subform CONTROL.
 
D

Dudley

Thanks very much for your help. As you suggested, the problem was that I was
using the field name instead of the control name. Can you also advise how I
can then copy record 2 in SubscriberSubForm to Subscriber 2 etc, or point me
to a source of advice on this.

Thanks
Dudley

Douglas J. Steele said:
The name implies that SubscriberSubForm is a subform. If that's the case, be
aware that subforms are not added to the Forms collection: they're not
"open" in the traditional sense. You have to refer to them via the form on
which they're hosted. See http://www.mvps.org/access/forms/frm0031.htm for a
good reference on how to do that.

Be aware that, depending on how the form is added as a subform, the name of
the subform control may not be the same as the name of the form being used
as a subform. Make sure you're using the name of the subform CONTROL.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Dudley said:
I am trying to copy from two forms to a third one with code

Dim stdocname As String
Dim stlinkcriteria As String

stdocname = "MemoForm"
stlinkcriteria = "[EnvelopeNumber]=" & Me![EnvelopeNumber]
DoCmd.OpenForm "MemoForm", , , stlinkcriteria
[Forms]!MemoForm.EnvelopeNumber = Me.EnvelopeNumber
[Forms]!MemoForm.CompanyFullName = Me.CompanyName & " " & Me.LIMITED
DoCmd.OpenForm "SubscriberSubForm", , , stlinkcriteria
[Forms]!MemoForm.Subscriber1 = [Forms]!SubscriberSubForm.Forenames & "
"
& [Forms]!SubscriberSubForm.Surname

Copying from the open form works, but the last line to copy from a third
form gives error 'Application or object defined error'. How can I do this?

Thanks
Dudley
 
D

Douglas J. Steele

I'm sorry, I don't understand the question.

In general, you shouldn't rely on copying values from one form to another.
Forms are simply windows into data contained in tables: you should ensure
that the data's in the form's RecordSource.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Dudley said:
Thanks very much for your help. As you suggested, the problem was that I
was
using the field name instead of the control name. Can you also advise how
I
can then copy record 2 in SubscriberSubForm to Subscriber 2 etc, or point
me
to a source of advice on this.

Thanks
Dudley

Douglas J. Steele said:
The name implies that SubscriberSubForm is a subform. If that's the case,
be
aware that subforms are not added to the Forms collection: they're not
"open" in the traditional sense. You have to refer to them via the form
on
which they're hosted. See http://www.mvps.org/access/forms/frm0031.htm
for a
good reference on how to do that.

Be aware that, depending on how the form is added as a subform, the name
of
the subform control may not be the same as the name of the form being
used
as a subform. Make sure you're using the name of the subform CONTROL.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Dudley said:
I am trying to copy from two forms to a third one with code

Dim stdocname As String
Dim stlinkcriteria As String

stdocname = "MemoForm"
stlinkcriteria = "[EnvelopeNumber]=" & Me![EnvelopeNumber]
DoCmd.OpenForm "MemoForm", , , stlinkcriteria
[Forms]!MemoForm.EnvelopeNumber = Me.EnvelopeNumber
[Forms]!MemoForm.CompanyFullName = Me.CompanyName & " " & Me.LIMITED
DoCmd.OpenForm "SubscriberSubForm", , , stlinkcriteria
[Forms]!MemoForm.Subscriber1 = [Forms]!SubscriberSubForm.Forenames &
"
"
& [Forms]!SubscriberSubForm.Surname

Copying from the open form works, but the last line to copy from a
third
form gives error 'Application or object defined error'. How can I do
this?

Thanks
Dudley
 
D

Dudley

Sorry I didn't make myself clear. I am using Albert Kallal's Wordmerge, but
for this application, I have found the problem that when there is a subform,
it only merges the first record. To get round this, I am trying to create a
command button which will copy the data I need to a separate table which has
all the data I need. The data I need in record 1 in the subscriber
subform/table is copied to Subscriber 1 field in the new table, record 2 to
Subscriber 2 field and so on. I can then Wordmerge on a form which is based
on one table with all the data I need.

I can now copy record 1 to Subscriber 1 field, but I do not know how to
proceed with the additional records as I do not understand looping.

Does this make sense?

Thanks very much for your help.
Dudley

Douglas J. Steele said:
I'm sorry, I don't understand the question.

In general, you shouldn't rely on copying values from one form to another.
Forms are simply windows into data contained in tables: you should ensure
that the data's in the form's RecordSource.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Dudley said:
Thanks very much for your help. As you suggested, the problem was that I
was
using the field name instead of the control name. Can you also advise how
I
can then copy record 2 in SubscriberSubForm to Subscriber 2 etc, or point
me
to a source of advice on this.

Thanks
Dudley

Douglas J. Steele said:
The name implies that SubscriberSubForm is a subform. If that's the case,
be
aware that subforms are not added to the Forms collection: they're not
"open" in the traditional sense. You have to refer to them via the form
on
which they're hosted. See http://www.mvps.org/access/forms/frm0031.htm
for a
good reference on how to do that.

Be aware that, depending on how the form is added as a subform, the name
of
the subform control may not be the same as the name of the form being
used
as a subform. Make sure you're using the name of the subform CONTROL.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I am trying to copy from two forms to a third one with code

Dim stdocname As String
Dim stlinkcriteria As String

stdocname = "MemoForm"
stlinkcriteria = "[EnvelopeNumber]=" & Me![EnvelopeNumber]
DoCmd.OpenForm "MemoForm", , , stlinkcriteria
[Forms]!MemoForm.EnvelopeNumber = Me.EnvelopeNumber
[Forms]!MemoForm.CompanyFullName = Me.CompanyName & " " & Me.LIMITED
DoCmd.OpenForm "SubscriberSubForm", , , stlinkcriteria
[Forms]!MemoForm.Subscriber1 = [Forms]!SubscriberSubForm.Forenames &
"
"
& [Forms]!SubscriberSubForm.Surname

Copying from the open form works, but the last line to copy from a
third
form gives error 'Application or object defined error'. How can I do
this?

Thanks
Dudley
 
D

Douglas J. Steele

There's no need to create a separate table. You can do Wordmerge on a query.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Dudley said:
Sorry I didn't make myself clear. I am using Albert Kallal's Wordmerge,
but
for this application, I have found the problem that when there is a
subform,
it only merges the first record. To get round this, I am trying to create
a
command button which will copy the data I need to a separate table which
has
all the data I need. The data I need in record 1 in the subscriber
subform/table is copied to Subscriber 1 field in the new table, record 2
to
Subscriber 2 field and so on. I can then Wordmerge on a form which is
based
on one table with all the data I need.

I can now copy record 1 to Subscriber 1 field, but I do not know how to
proceed with the additional records as I do not understand looping.

Does this make sense?

Thanks very much for your help.
Dudley

Douglas J. Steele said:
I'm sorry, I don't understand the question.

In general, you shouldn't rely on copying values from one form to
another.
Forms are simply windows into data contained in tables: you should ensure
that the data's in the form's RecordSource.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Dudley said:
Thanks very much for your help. As you suggested, the problem was that
I
was
using the field name instead of the control name. Can you also advise
how
I
can then copy record 2 in SubscriberSubForm to Subscriber 2 etc, or
point
me
to a source of advice on this.

Thanks
Dudley

:

The name implies that SubscriberSubForm is a subform. If that's the
case,
be
aware that subforms are not added to the Forms collection: they're not
"open" in the traditional sense. You have to refer to them via the
form
on
which they're hosted. See http://www.mvps.org/access/forms/frm0031.htm
for a
good reference on how to do that.

Be aware that, depending on how the form is added as a subform, the
name
of
the subform control may not be the same as the name of the form being
used
as a subform. Make sure you're using the name of the subform CONTROL.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I am trying to copy from two forms to a third one with code

Dim stdocname As String
Dim stlinkcriteria As String

stdocname = "MemoForm"
stlinkcriteria = "[EnvelopeNumber]=" & Me![EnvelopeNumber]
DoCmd.OpenForm "MemoForm", , , stlinkcriteria
[Forms]!MemoForm.EnvelopeNumber = Me.EnvelopeNumber
[Forms]!MemoForm.CompanyFullName = Me.CompanyName & " " &
Me.LIMITED
DoCmd.OpenForm "SubscriberSubForm", , , stlinkcriteria
[Forms]!MemoForm.Subscriber1 =
[Forms]!SubscriberSubForm.Forenames &
"
"
& [Forms]!SubscriberSubForm.Surname

Copying from the open form works, but the last line to copy from a
third
form gives error 'Application or object defined error'. How can I do
this?

Thanks
Dudley
 
D

Dudley

Thanks for the advice. I did try merging on a query but it created a separate
document for each record in the subscriber table, whereas I need the
subscribers listed in one document.

Can I loop in a query so that query field Subscriber 1 takes data from
Subscriber table record 1, field Subscriber 2 from record 2 and so on?

Thanks.
Dudley

Douglas J. Steele said:
There's no need to create a separate table. You can do Wordmerge on a query.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Dudley said:
Sorry I didn't make myself clear. I am using Albert Kallal's Wordmerge,
but
for this application, I have found the problem that when there is a
subform,
it only merges the first record. To get round this, I am trying to create
a
command button which will copy the data I need to a separate table which
has
all the data I need. The data I need in record 1 in the subscriber
subform/table is copied to Subscriber 1 field in the new table, record 2
to
Subscriber 2 field and so on. I can then Wordmerge on a form which is
based
on one table with all the data I need.

I can now copy record 1 to Subscriber 1 field, but I do not know how to
proceed with the additional records as I do not understand looping.

Does this make sense?

Thanks very much for your help.
Dudley

Douglas J. Steele said:
I'm sorry, I don't understand the question.

In general, you shouldn't rely on copying values from one form to
another.
Forms are simply windows into data contained in tables: you should ensure
that the data's in the form's RecordSource.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Thanks very much for your help. As you suggested, the problem was that
I
was
using the field name instead of the control name. Can you also advise
how
I
can then copy record 2 in SubscriberSubForm to Subscriber 2 etc, or
point
me
to a source of advice on this.

Thanks
Dudley

:

The name implies that SubscriberSubForm is a subform. If that's the
case,
be
aware that subforms are not added to the Forms collection: they're not
"open" in the traditional sense. You have to refer to them via the
form
on
which they're hosted. See http://www.mvps.org/access/forms/frm0031.htm
for a
good reference on how to do that.

Be aware that, depending on how the form is added as a subform, the
name
of
the subform control may not be the same as the name of the form being
used
as a subform. Make sure you're using the name of the subform CONTROL.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I am trying to copy from two forms to a third one with code

Dim stdocname As String
Dim stlinkcriteria As String

stdocname = "MemoForm"
stlinkcriteria = "[EnvelopeNumber]=" & Me![EnvelopeNumber]
DoCmd.OpenForm "MemoForm", , , stlinkcriteria
[Forms]!MemoForm.EnvelopeNumber = Me.EnvelopeNumber
[Forms]!MemoForm.CompanyFullName = Me.CompanyName & " " &
Me.LIMITED
DoCmd.OpenForm "SubscriberSubForm", , , stlinkcriteria
[Forms]!MemoForm.Subscriber1 =
[Forms]!SubscriberSubForm.Forenames &
"
"
& [Forms]!SubscriberSubForm.Surname

Copying from the open form works, but the last line to copy from a
third
form gives error 'Application or object defined error'. How can I do
this?

Thanks
Dudley
 
D

Douglas J. Steele

You might be able to create a Crosstab query that will do that, but it
sounds like a stretch.

How is your data structured, and how many subscribers do you need to display
on a single row?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Dudley said:
Thanks for the advice. I did try merging on a query but it created a
separate
document for each record in the subscriber table, whereas I need the
subscribers listed in one document.

Can I loop in a query so that query field Subscriber 1 takes data from
Subscriber table record 1, field Subscriber 2 from record 2 and so on?

Thanks.
Dudley

Douglas J. Steele said:
There's no need to create a separate table. You can do Wordmerge on a
query.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Dudley said:
Sorry I didn't make myself clear. I am using Albert Kallal's Wordmerge,
but
for this application, I have found the problem that when there is a
subform,
it only merges the first record. To get round this, I am trying to
create
a
command button which will copy the data I need to a separate table
which
has
all the data I need. The data I need in record 1 in the subscriber
subform/table is copied to Subscriber 1 field in the new table, record
2
to
Subscriber 2 field and so on. I can then Wordmerge on a form which is
based
on one table with all the data I need.

I can now copy record 1 to Subscriber 1 field, but I do not know how to
proceed with the additional records as I do not understand looping.

Does this make sense?

Thanks very much for your help.
Dudley

:

I'm sorry, I don't understand the question.

In general, you shouldn't rely on copying values from one form to
another.
Forms are simply windows into data contained in tables: you should
ensure
that the data's in the form's RecordSource.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Thanks very much for your help. As you suggested, the problem was
that
I
was
using the field name instead of the control name. Can you also
advise
how
I
can then copy record 2 in SubscriberSubForm to Subscriber 2 etc, or
point
me
to a source of advice on this.

Thanks
Dudley

:

The name implies that SubscriberSubForm is a subform. If that's the
case,
be
aware that subforms are not added to the Forms collection: they're
not
"open" in the traditional sense. You have to refer to them via the
form
on
which they're hosted. See
http://www.mvps.org/access/forms/frm0031.htm
for a
good reference on how to do that.

Be aware that, depending on how the form is added as a subform, the
name
of
the subform control may not be the same as the name of the form
being
used
as a subform. Make sure you're using the name of the subform
CONTROL.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I am trying to copy from two forms to a third one with code

Dim stdocname As String
Dim stlinkcriteria As String

stdocname = "MemoForm"
stlinkcriteria = "[EnvelopeNumber]=" & Me![EnvelopeNumber]
DoCmd.OpenForm "MemoForm", , , stlinkcriteria
[Forms]!MemoForm.EnvelopeNumber = Me.EnvelopeNumber
[Forms]!MemoForm.CompanyFullName = Me.CompanyName & " " &
Me.LIMITED
DoCmd.OpenForm "SubscriberSubForm", , , stlinkcriteria
[Forms]!MemoForm.Subscriber1 =
[Forms]!SubscriberSubForm.Forenames &
"
"
& [Forms]!SubscriberSubForm.Surname

Copying from the open form works, but the last line to copy from
a
third
form gives error 'Application or object defined error'. How can I
do
this?

Thanks
Dudley
 
D

Dudley

I only need to allow for five fields in the Word document, two for the
company name from the main Company table, and three from the Subscriber
table, shown in the Word document as either forenames plus surname, or
company name if the subscriber is a company. The subscribers are listed in
the Word document one to a line. The number of subscribers is open ended, but
in practice I should not need to allow for more than ten.

Thanks very much for your help.
Dudley


Douglas J. Steele said:
You might be able to create a Crosstab query that will do that, but it
sounds like a stretch.

How is your data structured, and how many subscribers do you need to display
on a single row?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Dudley said:
Thanks for the advice. I did try merging on a query but it created a
separate
document for each record in the subscriber table, whereas I need the
subscribers listed in one document.

Can I loop in a query so that query field Subscriber 1 takes data from
Subscriber table record 1, field Subscriber 2 from record 2 and so on?

Thanks.
Dudley

Douglas J. Steele said:
There's no need to create a separate table. You can do Wordmerge on a
query.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Sorry I didn't make myself clear. I am using Albert Kallal's Wordmerge,
but
for this application, I have found the problem that when there is a
subform,
it only merges the first record. To get round this, I am trying to
create
a
command button which will copy the data I need to a separate table
which
has
all the data I need. The data I need in record 1 in the subscriber
subform/table is copied to Subscriber 1 field in the new table, record
2
to
Subscriber 2 field and so on. I can then Wordmerge on a form which is
based
on one table with all the data I need.

I can now copy record 1 to Subscriber 1 field, but I do not know how to
proceed with the additional records as I do not understand looping.

Does this make sense?

Thanks very much for your help.
Dudley

:

I'm sorry, I don't understand the question.

In general, you shouldn't rely on copying values from one form to
another.
Forms are simply windows into data contained in tables: you should
ensure
that the data's in the form's RecordSource.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Thanks very much for your help. As you suggested, the problem was
that
I
was
using the field name instead of the control name. Can you also
advise
how
I
can then copy record 2 in SubscriberSubForm to Subscriber 2 etc, or
point
me
to a source of advice on this.

Thanks
Dudley

:

The name implies that SubscriberSubForm is a subform. If that's the
case,
be
aware that subforms are not added to the Forms collection: they're
not
"open" in the traditional sense. You have to refer to them via the
form
on
which they're hosted. See
http://www.mvps.org/access/forms/frm0031.htm
for a
good reference on how to do that.

Be aware that, depending on how the form is added as a subform, the
name
of
the subform control may not be the same as the name of the form
being
used
as a subform. Make sure you're using the name of the subform
CONTROL.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I am trying to copy from two forms to a third one with code

Dim stdocname As String
Dim stlinkcriteria As String

stdocname = "MemoForm"
stlinkcriteria = "[EnvelopeNumber]=" & Me![EnvelopeNumber]
DoCmd.OpenForm "MemoForm", , , stlinkcriteria
[Forms]!MemoForm.EnvelopeNumber = Me.EnvelopeNumber
[Forms]!MemoForm.CompanyFullName = Me.CompanyName & " " &
Me.LIMITED
DoCmd.OpenForm "SubscriberSubForm", , , stlinkcriteria
[Forms]!MemoForm.Subscriber1 =
[Forms]!SubscriberSubForm.Forenames &
"
"
& [Forms]!SubscriberSubForm.Surname

Copying from the open form works, but the last line to copy from
a
third
form gives error 'Application or object defined error'. How can I
do
this?

Thanks
Dudley
 
D

Douglas J. Steele

No easy solution occurs to me.

Sorry.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Dudley said:
I only need to allow for five fields in the Word document, two for the
company name from the main Company table, and three from the Subscriber
table, shown in the Word document as either forenames plus surname, or
company name if the subscriber is a company. The subscribers are listed in
the Word document one to a line. The number of subscribers is open ended,
but
in practice I should not need to allow for more than ten.

Thanks very much for your help.
Dudley


Douglas J. Steele said:
You might be able to create a Crosstab query that will do that, but it
sounds like a stretch.

How is your data structured, and how many subscribers do you need to
display
on a single row?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Dudley said:
Thanks for the advice. I did try merging on a query but it created a
separate
document for each record in the subscriber table, whereas I need the
subscribers listed in one document.

Can I loop in a query so that query field Subscriber 1 takes data from
Subscriber table record 1, field Subscriber 2 from record 2 and so on?

Thanks.
Dudley

:

There's no need to create a separate table. You can do Wordmerge on a
query.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Sorry I didn't make myself clear. I am using Albert Kallal's
Wordmerge,
but
for this application, I have found the problem that when there is a
subform,
it only merges the first record. To get round this, I am trying to
create
a
command button which will copy the data I need to a separate table
which
has
all the data I need. The data I need in record 1 in the subscriber
subform/table is copied to Subscriber 1 field in the new table,
record
2
to
Subscriber 2 field and so on. I can then Wordmerge on a form which
is
based
on one table with all the data I need.

I can now copy record 1 to Subscriber 1 field, but I do not know how
to
proceed with the additional records as I do not understand looping.

Does this make sense?

Thanks very much for your help.
Dudley

:

I'm sorry, I don't understand the question.

In general, you shouldn't rely on copying values from one form to
another.
Forms are simply windows into data contained in tables: you should
ensure
that the data's in the form's RecordSource.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Thanks very much for your help. As you suggested, the problem was
that
I
was
using the field name instead of the control name. Can you also
advise
how
I
can then copy record 2 in SubscriberSubForm to Subscriber 2 etc,
or
point
me
to a source of advice on this.

Thanks
Dudley

:

The name implies that SubscriberSubForm is a subform. If that's
the
case,
be
aware that subforms are not added to the Forms collection:
they're
not
"open" in the traditional sense. You have to refer to them via
the
form
on
which they're hosted. See
http://www.mvps.org/access/forms/frm0031.htm
for a
good reference on how to do that.

Be aware that, depending on how the form is added as a subform,
the
name
of
the subform control may not be the same as the name of the form
being
used
as a subform. Make sure you're using the name of the subform
CONTROL.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I am trying to copy from two forms to a third one with code

Dim stdocname As String
Dim stlinkcriteria As String

stdocname = "MemoForm"
stlinkcriteria = "[EnvelopeNumber]=" & Me![EnvelopeNumber]
DoCmd.OpenForm "MemoForm", , , stlinkcriteria
[Forms]!MemoForm.EnvelopeNumber = Me.EnvelopeNumber
[Forms]!MemoForm.CompanyFullName = Me.CompanyName & " " &
Me.LIMITED
DoCmd.OpenForm "SubscriberSubForm", , , stlinkcriteria
[Forms]!MemoForm.Subscriber1 =
[Forms]!SubscriberSubForm.Forenames &
"
"
& [Forms]!SubscriberSubForm.Surname

Copying from the open form works, but the last line to copy
from
a
third
form gives error 'Application or object defined error'. How
can I
do
this?

Thanks
Dudley
 
D

Dudley

Thanks very much for your trouble.
Dudley

Douglas J. Steele said:
No easy solution occurs to me.

Sorry.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Dudley said:
I only need to allow for five fields in the Word document, two for the
company name from the main Company table, and three from the Subscriber
table, shown in the Word document as either forenames plus surname, or
company name if the subscriber is a company. The subscribers are listed in
the Word document one to a line. The number of subscribers is open ended,
but
in practice I should not need to allow for more than ten.

Thanks very much for your help.
Dudley


Douglas J. Steele said:
You might be able to create a Crosstab query that will do that, but it
sounds like a stretch.

How is your data structured, and how many subscribers do you need to
display
on a single row?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Thanks for the advice. I did try merging on a query but it created a
separate
document for each record in the subscriber table, whereas I need the
subscribers listed in one document.

Can I loop in a query so that query field Subscriber 1 takes data from
Subscriber table record 1, field Subscriber 2 from record 2 and so on?

Thanks.
Dudley

:

There's no need to create a separate table. You can do Wordmerge on a
query.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Sorry I didn't make myself clear. I am using Albert Kallal's
Wordmerge,
but
for this application, I have found the problem that when there is a
subform,
it only merges the first record. To get round this, I am trying to
create
a
command button which will copy the data I need to a separate table
which
has
all the data I need. The data I need in record 1 in the subscriber
subform/table is copied to Subscriber 1 field in the new table,
record
2
to
Subscriber 2 field and so on. I can then Wordmerge on a form which
is
based
on one table with all the data I need.

I can now copy record 1 to Subscriber 1 field, but I do not know how
to
proceed with the additional records as I do not understand looping.

Does this make sense?

Thanks very much for your help.
Dudley

:

I'm sorry, I don't understand the question.

In general, you shouldn't rely on copying values from one form to
another.
Forms are simply windows into data contained in tables: you should
ensure
that the data's in the form's RecordSource.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Thanks very much for your help. As you suggested, the problem was
that
I
was
using the field name instead of the control name. Can you also
advise
how
I
can then copy record 2 in SubscriberSubForm to Subscriber 2 etc,
or
point
me
to a source of advice on this.

Thanks
Dudley

:

The name implies that SubscriberSubForm is a subform. If that's
the
case,
be
aware that subforms are not added to the Forms collection:
they're
not
"open" in the traditional sense. You have to refer to them via
the
form
on
which they're hosted. See
http://www.mvps.org/access/forms/frm0031.htm
for a
good reference on how to do that.

Be aware that, depending on how the form is added as a subform,
the
name
of
the subform control may not be the same as the name of the form
being
used
as a subform. Make sure you're using the name of the subform
CONTROL.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I am trying to copy from two forms to a third one with code

Dim stdocname As String
Dim stlinkcriteria As String

stdocname = "MemoForm"
stlinkcriteria = "[EnvelopeNumber]=" & Me![EnvelopeNumber]
DoCmd.OpenForm "MemoForm", , , stlinkcriteria
[Forms]!MemoForm.EnvelopeNumber = Me.EnvelopeNumber
[Forms]!MemoForm.CompanyFullName = Me.CompanyName & " " &
Me.LIMITED
DoCmd.OpenForm "SubscriberSubForm", , , stlinkcriteria
[Forms]!MemoForm.Subscriber1 =
[Forms]!SubscriberSubForm.Forenames &
"
"
& [Forms]!SubscriberSubForm.Surname

Copying from the open form works, but the last line to copy
from
a
third
form gives error 'Application or object defined error'. How
can I
do
this?

Thanks
Dudley
 

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