Report from Form and 2 subforms

  • Thread starter Thread starter Biecci
  • Start date Start date
B

Biecci

I have a form (which consist of 2 subforms), created from a query, and I
have a button that prints a report using the data from the query behind
the forms.
I need to tell the report to only use the records that are
currently active on the form and the 2 subforms. but seems not be making
any headway. I already tried the solution given to "Wayne" i.e

".........

If Me.Dirty Then 'Save any changes.
Me.Dirty = False
End If
If Me.NewRecord Then
MsgBox "Select/enter a record to print."
Else
strProg = "[ProjectID] = " & Me.[ProjectID]
DoCmd.OpenReport "Conversation Summary", acViewPreview,
, strProg
End If
End Sub

.............."

but got "Enter Parameter value" dialog box.


Can anyone please help me out?

Thanks
 
Do you have a field in your main report named [ProjectID]? Do you have a
control on your form named [ProjectID]? Does your "Enter Parameter value"
dialog box ask for anything more specific?
 
The Record Source of my form is from table Customer, (which is the one
of the tables I created the query from), hence I used Customer_ID in the
code instead of the "ProjectID" from given in the code sent to Wayne.

i.e ..........................

strReport = "[Customer_ID] = " & Me.[Customer_ID]
..................................

My first Subform has the following Data:

Name : Orders Subform
Source Object: Orders Subform
Link Child Fields: Customer_id
Link Master Fields: Customer_id

and the second Subform also has the following Data:

Name : OrderProductDetail Subform
Source Object: OrderProductDetail Subform
Link Child Fields: Order_id
Link Master Fields: [Orders Subform].Form![Order_Number]





Originally posted by Duane Hookom
Do you have a field in your main report named [ProjectID]? Do
you have a
control on your form named [ProjectID]? Does your "Enter
Parameter value"
dialog box ask for anything more specific?
--
Duane Hookom
MS Access MVP


"Biecci" wrote in message
I have a form (which consist of 2 subforms), created from a query, and I
have a button that prints a report using the data from the query behind
the forms.
I need to tell the report to only use the records that are
currently active on the form and the 2 subforms. but seems not be making
any headway. I already tried the solution given to "Wayne" i.e
".........
If Me.Dirty Then 'Save any changes.
Me.Dirty = False
End If
If Me.NewRecord Then
MsgBox "Select/enter a record to print."
Else
strProg = "[ProjectID] = " & Me.[ProjectID]
DoCmd.OpenReport "Conversation Summary", acViewPreview,
, strProg
End If
End Sub
............."
but got "Enter Parameter value" dialog box.
Can anyone please help me out?
Thanks
--
Posted via
http://dbforums.com/http://dbforums.com
 
So, you have a control on your form named [Customer_ID]. Do you have a field
in your main report named [Customer_ID]? Does your "Enter Parameter value"
dialog box ask for anything more specific?

--
Duane Hookom
MS Access MVP


Biecci said:
The Record Source of my form is from table Customer, (which is the one
of the tables I created the query from), hence I used Customer_ID in the
code instead of the "ProjectID" from given in the code sent to Wayne.

i.e ..........................

strReport = "[Customer_ID] = " & Me.[Customer_ID]
.................................

My first Subform has the following Data:

Name : Orders Subform
Source Object: Orders Subform
Link Child Fields: Customer_id
Link Master Fields: Customer_id

and the second Subform also has the following Data:

Name : OrderProductDetail Subform
Source Object: OrderProductDetail Subform
Link Child Fields: Order_id
Link Master Fields: [Orders Subform].Form![Order_Number]





Originally posted by Duane Hookom
Do you have a field in your main report named [ProjectID]? Do
you have a
control on your form named [ProjectID]? Does your "Enter
Parameter value"
dialog box ask for anything more specific?
--
Duane Hookom
MS Access MVP


"Biecci" wrote in message
I have a form (which consist of 2 subforms), created from a query, and I
have a button that prints a report using the data from the query behind
the forms.
I need to tell the report to only use the records that are
currently active on the form and the 2 subforms. but seems not be making
any headway. I already tried the solution given to "Wayne" i.e
".........
If Me.Dirty Then 'Save any changes.
Me.Dirty = False
End If
If Me.NewRecord Then
MsgBox "Select/enter a record to print."
Else
strProg = "[ProjectID] = " & Me.[ProjectID]
DoCmd.OpenReport "Conversation Summary", acViewPreview,
, strProg
End If
End Sub
............."
but got "Enter Parameter value" dialog box.
Can anyone please help me out?
Thanks
--
Posted via
http://dbforums.com/http://dbforums.com
 
Yes, I have a field in my report named [Customer_ID]. The "Enter
Parameter value" dialog box is specifically asking for parameter value
for the Customer_ID because the first record from my query with
Customer_ID "ADS", which is the first record on my form is displayed
just above the dialog box. Pls. be informed that I built this
Form/Subforms from query using wizard with option to view the form data
by "Customer"


Originally posted by Duane Hookom
So, you have a control on your form named [Customer_ID]. Do you
have a field
in your main report named [Customer_ID]? Does your "Enter
Parameter value"
dialog box ask for anything more specific?

--
Duane Hookom
MS Access MVP


"Biecci" wrote in message
The Record Source of my form is from table Customer, (which is the one
of the tables I created the query from), hence I used Customer_ID in the
code instead of the "ProjectID" from given in the code sent to Wayne.
i.e ..........................
strReport = "[Customer_ID] = " & Me.[Customer_ID]
.................................
My first Subform has the following Data:
Name : Orders Subform
Source Object: Orders Subform
Link Child Fields: Customer_id
Link Master Fields: Customer_id
and the second Subform also has the following Data:
Name : OrderProductDetail Subform
Source Object: OrderProductDetail Subform
Link Child Fields: Order_id
Link Master Fields: [Orders Subform].Form![Order_Number]
Originally posted by Duane Hookom
Do you have a field in your main report named [ProjectID]? Do
you have a
control on your form named [ProjectID]? Does your "Enter
Parameter value"
dialog box ask for anything more specific?
--
Duane Hookom
MS Access MVP


"Biecci" wrote in message
news:[email protected]"]news:3170602.1059-
[email protected][/url]"]news:3170602.1059666766@d-"]news-
:3170602.1059666766@d-[/url]
bforums.com[/url]...
I have a form (which consist of 2 subforms), created from a
query, and I
have a button that prints a report using the data from the query
behind
the forms.
I need to tell the report to only use the records that are
currently active on the form and the 2 subforms. but seems not
be making
any headway. I already tried the solution given to "Wayne"
i.e
".........
If Me.Dirty Then 'Save any changes.
Me.Dirty = False
End If
If Me.NewRecord Then
MsgBox "Select/enter a record to print."
Else
strProg = "[ProjectID] = " & Me.[ProjectID]
DoCmd.OpenReport "Conversation Summary", acViewPreview,
, strProg
End If
End Sub
............."
but got "Enter Parameter value" dialog box.
Can anyone please help me out?
Thanks
ums.com/http://dbforums.com[/URL]
--
Posted via
http://dbforums.com/http://dbforums.com
 
Here it goes:


Private Sub cmdOpenReport_Click()

Dim strReport As String

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

If Me.NewRecord Then
MsgBox "Select/enter a record to print."
Else

strReport = "[Customer_id] = " & Me.[Customer_id]

DoCmd.OpenReport "Customers", acViewPreview, , strReport
End If

End Sub


Meanwhile, I really appreciate your effort.

Originally posted by Duane Hookom
Could you paste your current code into a message? The first code
you pasted
couldn't have been your code since it had ProjectID rather than
Customer_ID.

--
Duane Hookom
MS Access MVP


"Biecci" wrote in message
Yes, I have a field in my report named [Customer_ID]. The "Enter
Parameter value" dialog box is specifically asking for parameter value
for the Customer_ID because the first record from my query with
Customer_ID "ADS", which is the first record on my form is displayed
just above the dialog box. Pls. be informed that I built this
Form/Subforms from query using wizard with option to view the form data
by "Customer"
Originally posted by Duane Hookom
So, you have a control on your form named [Customer_ID]. Do you
have a field
in your main report named [Customer_ID]? Does your "Enter
Parameter value"
dialog box ask for anything more specific?

--
Duane Hookom
MS Access MVP


"Biecci" wrote in message
news:[email protected]"]news:3171665.1059-
[email protected][/url]"]news:3171665.1059677628@d-"]news-
:3171665.1059677628@d-[/url]
bforums.com[/url]...
The Record Source of my form is from table Customer, (which is
the one
of the tables I created the query from), hence I used
Customer_ID in the
code instead of the "ProjectID" from given in the code sent to
Wayne.
i.e ..........................
strReport = "[Customer_ID] = " & Me.[Customer_ID]
.................................
My first Subform has the following Data:
Name : Orders Subform
Source Object: Orders Subform
Link Child Fields: Customer_id
Link Master Fields: Customer_id
and the second Subform also has the following Data:
Name : OrderProductDetail Subform
Source Object: OrderProductDetail Subform
Link Child Fields: Order_id
Link Master Fields: [Orders Subform].Form![Order_Number]
Originally posted by Duane Hookom
Do you have a field in your main report named [ProjectID]?
Do
you have a
control on your form named [ProjectID]? Does your "Enter
Parameter value"
dialog box ask for anything more specific?
--
Duane Hookom
MS Access MVP


"Biecci" wrote in message
[email protected][/url]"]news:3170602.1059666766@- d-news:3170602.1059666766@d-"]news-
:3170602.1059666766@d-[/url]
bforums.com[/url]...
I have a form (which consist of 2 subforms), created from
a
query, and I
have a button that prints a report using the data from the
query
behind
the forms.
I need to tell the report to only use the records that
are
currently active on the form and the 2 subforms. but seems
not
be making
any headway. I already tried the solution given to
"Wayne"
i.e
".........
If Me.Dirty Then 'Save any changes.
Me.Dirty = False
End If
If Me.NewRecord Then
MsgBox "Select/enter a record to print."
Else
strProg = "[ProjectID] = " & Me.[ProjectID]
DoCmd.OpenReport "Conversation Summary", acViewPreview,
, strProg
End If
End Sub
............."
but got "Enter Parameter value" dialog box.
Can anyone please help me out?
Thanks
bforums.com/http://dbforums.com[/URL]"]http://dbfor-/"]http-
://dbfor-[/url]
ums.com/http://dbforums.com[/URL]
--
Posted via
http://dbforums.com/http://dbforums.com
 
Boy!...It works!!!... It actually works!!! Wow...You're the hero of the
day Duane... Thanks a lot.

George
 
Back
Top