Current form does not match report?

  • Thread starter Thread starter jo
  • Start date Start date
J

jo

Hi I want to print a report that has just been updated by the form but they
do not corresponed with each other does any one knoww how to get them to
connect . My relationships match ect but. Should I put something in the
Filter box? please help if you can
Jo
 
Please provide much more detail about the structure of the report and form.
How are they related? What do you mean by "do not correspond with each
other"? Do you want to print the report while you're viewing the form?
 
Please provide much more detail about the structure of the report and form.
How are they related? What do you mean by "do not correspond with each
other"? Do you want to print the report while you're viewing the form?
 
Hi Ken thank you for replying, I have since fixed the problem by put the
following into the macro Where Condition:
[Forms]![GageInfo]![Gauge ID]=[GaugeInfo Query]![Gauge ID].

But I do have another problem which is:
I have a Multiple Selection print dialog form
Which I am operating with macros (because I am a novice with VBA!!). But
when I select a Dept from a List box and enter the dates into the "From Date"
and "To Date" I dont know how or to add the macro to look for the dates? I
have another selection there that does what i want it to do look for the
dates and it works???
In the macro that does work and is asking for All depts and set dates the
Where Condition is:
[OverDueNextYear]![DateOfNextCal] Between [Forms]![Print Advance
Dialog]![From Date] And [Forms]![Print Advance Dialog]![To Date]
And the one that does not work:
[OverDueNextYear]![Department]=[Forms]![Print Advance Dialog]![Select Dept]
I tried add the above to this one but it kept saying syntax error??
Can you help??
 
Hi Ken thank you for replying, I have since fixed the problem by put the
following into the macro Where Condition:
[Forms]![GageInfo]![Gauge ID]=[GaugeInfo Query]![Gauge ID].

But I do have another problem which is:
I have a Multiple Selection print dialog form
Which I am operating with macros (because I am a novice with VBA!!). But
when I select a Dept from a List box and enter the dates into the "From Date"
and "To Date" I dont know how or to add the macro to look for the dates? I
have another selection there that does what i want it to do look for the
dates and it works???
In the macro that does work and is asking for All depts and set dates the
Where Condition is:
[OverDueNextYear]![DateOfNextCal] Between [Forms]![Print Advance
Dialog]![From Date] And [Forms]![Print Advance Dialog]![To Date]
And the one that does not work:
[OverDueNextYear]![Department]=[Forms]![Print Advance Dialog]![Select Dept]
I tried add the above to this one but it kept saying syntax error??
Can you help??
 
The correct syntax for a WHERE clause when opening a report using OpenReport
macro action:

[NameOfField] = Forms![NameOfForm]![NameOfControl]

You do not use the table name in the WHERE clause. Assuming that Department
is the name of a field in your report's RecordSource query,

[Department]=[Forms]![Print Advance Dialog]![Select Dept]

You say the error you get is a syntax error? Are you trying to combine the
two criteria clauses from the [To Date] / [From Date], and [Select Dept]
controls? If yes:

[Department]=[Forms]![Print Advance Dialog]![Select Dept] And
[DateOfNextCal] Between [Forms]![Print Advance
Dialog]![From Date] And [Forms]![Print Advance Dialog]![To Date]


--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/




jo said:
Hi Ken thank you for replying, I have since fixed the problem by put the
following into the macro Where Condition:
[Forms]![GageInfo]![Gauge ID]=[GaugeInfo Query]![Gauge ID].

But I do have another problem which is:
I have a Multiple Selection print dialog form
Which I am operating with macros (because I am a novice with VBA!!). But
when I select a Dept from a List box and enter the dates into the "From
Date"
and "To Date" I dont know how or to add the macro to look for the dates? I
have another selection there that does what i want it to do look for the
dates and it works???
In the macro that does work and is asking for All depts and set dates the
Where Condition is:
[OverDueNextYear]![DateOfNextCal] Between [Forms]![Print Advance
Dialog]![From Date] And [Forms]![Print Advance Dialog]![To Date]
And the one that does not work:
[OverDueNextYear]![Department]=[Forms]![Print Advance Dialog]![Select
Dept]
I tried add the above to this one but it kept saying syntax error??
Can you help??


Ken Snell said:
Please provide much more detail about the structure of the report and
form.
How are they related? What do you mean by "do not correspond with each
other"? Do you want to print the report while you're viewing the form?
--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/
 
The correct syntax for a WHERE clause when opening a report using OpenReport
macro action:

[NameOfField] = Forms![NameOfForm]![NameOfControl]

You do not use the table name in the WHERE clause. Assuming that Department
is the name of a field in your report's RecordSource query,

[Department]=[Forms]![Print Advance Dialog]![Select Dept]

You say the error you get is a syntax error? Are you trying to combine the
two criteria clauses from the [To Date] / [From Date], and [Select Dept]
controls? If yes:

[Department]=[Forms]![Print Advance Dialog]![Select Dept] And
[DateOfNextCal] Between [Forms]![Print Advance
Dialog]![From Date] And [Forms]![Print Advance Dialog]![To Date]


--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/




jo said:
Hi Ken thank you for replying, I have since fixed the problem by put the
following into the macro Where Condition:
[Forms]![GageInfo]![Gauge ID]=[GaugeInfo Query]![Gauge ID].

But I do have another problem which is:
I have a Multiple Selection print dialog form
Which I am operating with macros (because I am a novice with VBA!!). But
when I select a Dept from a List box and enter the dates into the "From
Date"
and "To Date" I dont know how or to add the macro to look for the dates? I
have another selection there that does what i want it to do look for the
dates and it works???
In the macro that does work and is asking for All depts and set dates the
Where Condition is:
[OverDueNextYear]![DateOfNextCal] Between [Forms]![Print Advance
Dialog]![From Date] And [Forms]![Print Advance Dialog]![To Date]
And the one that does not work:
[OverDueNextYear]![Department]=[Forms]![Print Advance Dialog]![Select
Dept]
I tried add the above to this one but it kept saying syntax error??
Can you help??


Ken Snell said:
Please provide much more detail about the structure of the report and
form.
How are they related? What do you mean by "do not correspond with each
other"? Do you want to print the report while you're viewing the form?
--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/
 
Hi Ken
that has worked a treat thanks!!! But I have one more issue if you can help
again?? and this time my problem is with Option Groups that I have on the
same form as before. the first group hides a List Box (Select a Dept) as
requested. But the 2nd Group is not working correctly it is not hiding the
boxes? If user clicks on the first box THEN it will hide the "From Date" and
"To Date" boxes. But I want those boxes hidden until request by the user? Can
you help once again?
Thanks Jo
Ken Snell said:
The correct syntax for a WHERE clause when opening a report using OpenReport
macro action:

[NameOfField] = Forms![NameOfForm]![NameOfControl]

You do not use the table name in the WHERE clause. Assuming that Department
is the name of a field in your report's RecordSource query,

[Department]=[Forms]![Print Advance Dialog]![Select Dept]

You say the error you get is a syntax error? Are you trying to combine the
two criteria clauses from the [To Date] / [From Date], and [Select Dept]
controls? If yes:

[Department]=[Forms]![Print Advance Dialog]![Select Dept] And
[DateOfNextCal] Between [Forms]![Print Advance
Dialog]![From Date] And [Forms]![Print Advance Dialog]![To Date]


--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/




jo said:
Hi Ken thank you for replying, I have since fixed the problem by put the
following into the macro Where Condition:
[Forms]![GageInfo]![Gauge ID]=[GaugeInfo Query]![Gauge ID].

But I do have another problem which is:
I have a Multiple Selection print dialog form
Which I am operating with macros (because I am a novice with VBA!!). But
when I select a Dept from a List box and enter the dates into the "From
Date"
and "To Date" I dont know how or to add the macro to look for the dates? I
have another selection there that does what i want it to do look for the
dates and it works???
In the macro that does work and is asking for All depts and set dates the
Where Condition is:
[OverDueNextYear]![DateOfNextCal] Between [Forms]![Print Advance
Dialog]![From Date] And [Forms]![Print Advance Dialog]![To Date]
And the one that does not work:
[OverDueNextYear]![Department]=[Forms]![Print Advance Dialog]![Select
Dept]
I tried add the above to this one but it kept saying syntax error??
Can you help??


Ken Snell said:
Please provide much more detail about the structure of the report and
form.
How are they related? What do you mean by "do not correspond with each
other"? Do you want to print the report while you're viewing the form?
--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/


Hi I want to print a report that has just been updated by the form but
they
do not corresponed with each other does any one knoww how to get them
to
connect . My relationships match ect but. Should I put something in the
Filter box? please help if you can
Jo
 
Hi Ken
that has worked a treat thanks!!! But I have one more issue if you can help
again?? and this time my problem is with Option Groups that I have on the
same form as before. the first group hides a List Box (Select a Dept) as
requested. But the 2nd Group is not working correctly it is not hiding the
boxes? If user clicks on the first box THEN it will hide the "From Date" and
"To Date" boxes. But I want those boxes hidden until request by the user? Can
you help once again?
Thanks Jo
Ken Snell said:
The correct syntax for a WHERE clause when opening a report using OpenReport
macro action:

[NameOfField] = Forms![NameOfForm]![NameOfControl]

You do not use the table name in the WHERE clause. Assuming that Department
is the name of a field in your report's RecordSource query,

[Department]=[Forms]![Print Advance Dialog]![Select Dept]

You say the error you get is a syntax error? Are you trying to combine the
two criteria clauses from the [To Date] / [From Date], and [Select Dept]
controls? If yes:

[Department]=[Forms]![Print Advance Dialog]![Select Dept] And
[DateOfNextCal] Between [Forms]![Print Advance
Dialog]![From Date] And [Forms]![Print Advance Dialog]![To Date]


--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/




jo said:
Hi Ken thank you for replying, I have since fixed the problem by put the
following into the macro Where Condition:
[Forms]![GageInfo]![Gauge ID]=[GaugeInfo Query]![Gauge ID].

But I do have another problem which is:
I have a Multiple Selection print dialog form
Which I am operating with macros (because I am a novice with VBA!!). But
when I select a Dept from a List box and enter the dates into the "From
Date"
and "To Date" I dont know how or to add the macro to look for the dates? I
have another selection there that does what i want it to do look for the
dates and it works???
In the macro that does work and is asking for All depts and set dates the
Where Condition is:
[OverDueNextYear]![DateOfNextCal] Between [Forms]![Print Advance
Dialog]![From Date] And [Forms]![Print Advance Dialog]![To Date]
And the one that does not work:
[OverDueNextYear]![Department]=[Forms]![Print Advance Dialog]![Select
Dept]
I tried add the above to this one but it kept saying syntax error??
Can you help??


Ken Snell said:
Please provide much more detail about the structure of the report and
form.
How are they related? What do you mean by "do not correspond with each
other"? Do you want to print the report while you're viewing the form?
--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/


Hi I want to print a report that has just been updated by the form but
they
do not corresponed with each other does any one knoww how to get them
to
connect . My relationships match ect but. Should I put something in the
Filter box? please help if you can
Jo
 
In the form's Load event, set the Visible property of all three controls to
False:

Private Sub Form_Load()
Me.[Select Dept].Visible = False
Me.[To Date].Visible = False
Me.[From Date].Visible = False
End Sub


Then be sure that you're using the AfterUpdate event of the OptionGroup
control to reset the Visible property of the controls as needed.

--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/




jo said:
Hi Ken
that has worked a treat thanks!!! But I have one more issue if you can
help
again?? and this time my problem is with Option Groups that I have on the
same form as before. the first group hides a List Box (Select a Dept) as
requested. But the 2nd Group is not working correctly it is not hiding the
boxes? If user clicks on the first box THEN it will hide the "From Date"
and
"To Date" boxes. But I want those boxes hidden until request by the user?
Can
you help once again?
Thanks Jo
Ken Snell said:
The correct syntax for a WHERE clause when opening a report using
OpenReport
macro action:

[NameOfField] = Forms![NameOfForm]![NameOfControl]

You do not use the table name in the WHERE clause. Assuming that
Department
is the name of a field in your report's RecordSource query,

[Department]=[Forms]![Print Advance Dialog]![Select Dept]

You say the error you get is a syntax error? Are you trying to combine
the
two criteria clauses from the [To Date] / [From Date], and [Select Dept]
controls? If yes:

[Department]=[Forms]![Print Advance Dialog]![Select Dept] And
[DateOfNextCal] Between [Forms]![Print Advance
Dialog]![From Date] And [Forms]![Print Advance Dialog]![To Date]


--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/




jo said:
Hi Ken thank you for replying, I have since fixed the problem by put
the
following into the macro Where Condition:
[Forms]![GageInfo]![Gauge ID]=[GaugeInfo Query]![Gauge ID].

But I do have another problem which is:
I have a Multiple Selection print dialog form
Which I am operating with macros (because I am a novice with VBA!!).
But
when I select a Dept from a List box and enter the dates into the "From
Date"
and "To Date" I dont know how or to add the macro to look for the
dates? I
have another selection there that does what i want it to do look for
the
dates and it works???
In the macro that does work and is asking for All depts and set dates
the
Where Condition is:
[OverDueNextYear]![DateOfNextCal] Between [Forms]![Print Advance
Dialog]![From Date] And [Forms]![Print Advance Dialog]![To Date]
And the one that does not work:
[OverDueNextYear]![Department]=[Forms]![Print Advance Dialog]![Select
Dept]
I tried add the above to this one but it kept saying syntax error??
Can you help??


:

Please provide much more detail about the structure of the report and
form.
How are they related? What do you mean by "do not correspond with each
other"? Do you want to print the report while you're viewing the form?
--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/


Hi I want to print a report that has just been updated by the form
but
they
do not corresponed with each other does any one knoww how to get
them
to
connect . My relationships match ect but. Should I put something in
the
Filter box? please help if you can
Jo
 
In the form's Load event, set the Visible property of all three controls to
False:

Private Sub Form_Load()
Me.[Select Dept].Visible = False
Me.[To Date].Visible = False
Me.[From Date].Visible = False
End Sub


Then be sure that you're using the AfterUpdate event of the OptionGroup
control to reset the Visible property of the controls as needed.

--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/




jo said:
Hi Ken
that has worked a treat thanks!!! But I have one more issue if you can
help
again?? and this time my problem is with Option Groups that I have on the
same form as before. the first group hides a List Box (Select a Dept) as
requested. But the 2nd Group is not working correctly it is not hiding the
boxes? If user clicks on the first box THEN it will hide the "From Date"
and
"To Date" boxes. But I want those boxes hidden until request by the user?
Can
you help once again?
Thanks Jo
Ken Snell said:
The correct syntax for a WHERE clause when opening a report using
OpenReport
macro action:

[NameOfField] = Forms![NameOfForm]![NameOfControl]

You do not use the table name in the WHERE clause. Assuming that
Department
is the name of a field in your report's RecordSource query,

[Department]=[Forms]![Print Advance Dialog]![Select Dept]

You say the error you get is a syntax error? Are you trying to combine
the
two criteria clauses from the [To Date] / [From Date], and [Select Dept]
controls? If yes:

[Department]=[Forms]![Print Advance Dialog]![Select Dept] And
[DateOfNextCal] Between [Forms]![Print Advance
Dialog]![From Date] And [Forms]![Print Advance Dialog]![To Date]


--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/




jo said:
Hi Ken thank you for replying, I have since fixed the problem by put
the
following into the macro Where Condition:
[Forms]![GageInfo]![Gauge ID]=[GaugeInfo Query]![Gauge ID].

But I do have another problem which is:
I have a Multiple Selection print dialog form
Which I am operating with macros (because I am a novice with VBA!!).
But
when I select a Dept from a List box and enter the dates into the "From
Date"
and "To Date" I dont know how or to add the macro to look for the
dates? I
have another selection there that does what i want it to do look for
the
dates and it works???
In the macro that does work and is asking for All depts and set dates
the
Where Condition is:
[OverDueNextYear]![DateOfNextCal] Between [Forms]![Print Advance
Dialog]![From Date] And [Forms]![Print Advance Dialog]![To Date]
And the one that does not work:
[OverDueNextYear]![Department]=[Forms]![Print Advance Dialog]![Select
Dept]
I tried add the above to this one but it kept saying syntax error??
Can you help??


:

Please provide much more detail about the structure of the report and
form.
How are they related? What do you mean by "do not correspond with each
other"? Do you want to print the report while you're viewing the form?
--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/


Hi I want to print a report that has just been updated by the form
but
they
do not corresponed with each other does any one knoww how to get
them
to
connect . My relationships match ect but. Should I put something in
the
Filter box? please help if you can
Jo
 
Hi Ken once again that did the trick brilliant thank you for all your help.
Jo

Ken Snell said:
In the form's Load event, set the Visible property of all three controls to
False:

Private Sub Form_Load()
Me.[Select Dept].Visible = False
Me.[To Date].Visible = False
Me.[From Date].Visible = False
End Sub


Then be sure that you're using the AfterUpdate event of the OptionGroup
control to reset the Visible property of the controls as needed.

--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/




jo said:
Hi Ken
that has worked a treat thanks!!! But I have one more issue if you can
help
again?? and this time my problem is with Option Groups that I have on the
same form as before. the first group hides a List Box (Select a Dept) as
requested. But the 2nd Group is not working correctly it is not hiding the
boxes? If user clicks on the first box THEN it will hide the "From Date"
and
"To Date" boxes. But I want those boxes hidden until request by the user?
Can
you help once again?
Thanks Jo
Ken Snell said:
The correct syntax for a WHERE clause when opening a report using
OpenReport
macro action:

[NameOfField] = Forms![NameOfForm]![NameOfControl]

You do not use the table name in the WHERE clause. Assuming that
Department
is the name of a field in your report's RecordSource query,

[Department]=[Forms]![Print Advance Dialog]![Select Dept]

You say the error you get is a syntax error? Are you trying to combine
the
two criteria clauses from the [To Date] / [From Date], and [Select Dept]
controls? If yes:

[Department]=[Forms]![Print Advance Dialog]![Select Dept] And
[DateOfNextCal] Between [Forms]![Print Advance
Dialog]![From Date] And [Forms]![Print Advance Dialog]![To Date]


--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/




Hi Ken thank you for replying, I have since fixed the problem by put
the
following into the macro Where Condition:
[Forms]![GageInfo]![Gauge ID]=[GaugeInfo Query]![Gauge ID].

But I do have another problem which is:
I have a Multiple Selection print dialog form
Which I am operating with macros (because I am a novice with VBA!!).
But
when I select a Dept from a List box and enter the dates into the "From
Date"
and "To Date" I dont know how or to add the macro to look for the
dates? I
have another selection there that does what i want it to do look for
the
dates and it works???
In the macro that does work and is asking for All depts and set dates
the
Where Condition is:
[OverDueNextYear]![DateOfNextCal] Between [Forms]![Print Advance
Dialog]![From Date] And [Forms]![Print Advance Dialog]![To Date]
And the one that does not work:
[OverDueNextYear]![Department]=[Forms]![Print Advance Dialog]![Select
Dept]
I tried add the above to this one but it kept saying syntax error??
Can you help??


:

Please provide much more detail about the structure of the report and
form.
How are they related? What do you mean by "do not correspond with each
other"? Do you want to print the report while you're viewing the form?
--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/


Hi I want to print a report that has just been updated by the form
but
they
do not corresponed with each other does any one knoww how to get
them
to
connect . My relationships match ect but. Should I put something in
the
Filter box? please help if you can
Jo
 
Hi Ken once again that did the trick brilliant thank you for all your help.
Jo

Ken Snell said:
In the form's Load event, set the Visible property of all three controls to
False:

Private Sub Form_Load()
Me.[Select Dept].Visible = False
Me.[To Date].Visible = False
Me.[From Date].Visible = False
End Sub


Then be sure that you're using the AfterUpdate event of the OptionGroup
control to reset the Visible property of the controls as needed.

--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/




jo said:
Hi Ken
that has worked a treat thanks!!! But I have one more issue if you can
help
again?? and this time my problem is with Option Groups that I have on the
same form as before. the first group hides a List Box (Select a Dept) as
requested. But the 2nd Group is not working correctly it is not hiding the
boxes? If user clicks on the first box THEN it will hide the "From Date"
and
"To Date" boxes. But I want those boxes hidden until request by the user?
Can
you help once again?
Thanks Jo
Ken Snell said:
The correct syntax for a WHERE clause when opening a report using
OpenReport
macro action:

[NameOfField] = Forms![NameOfForm]![NameOfControl]

You do not use the table name in the WHERE clause. Assuming that
Department
is the name of a field in your report's RecordSource query,

[Department]=[Forms]![Print Advance Dialog]![Select Dept]

You say the error you get is a syntax error? Are you trying to combine
the
two criteria clauses from the [To Date] / [From Date], and [Select Dept]
controls? If yes:

[Department]=[Forms]![Print Advance Dialog]![Select Dept] And
[DateOfNextCal] Between [Forms]![Print Advance
Dialog]![From Date] And [Forms]![Print Advance Dialog]![To Date]


--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/




Hi Ken thank you for replying, I have since fixed the problem by put
the
following into the macro Where Condition:
[Forms]![GageInfo]![Gauge ID]=[GaugeInfo Query]![Gauge ID].

But I do have another problem which is:
I have a Multiple Selection print dialog form
Which I am operating with macros (because I am a novice with VBA!!).
But
when I select a Dept from a List box and enter the dates into the "From
Date"
and "To Date" I dont know how or to add the macro to look for the
dates? I
have another selection there that does what i want it to do look for
the
dates and it works???
In the macro that does work and is asking for All depts and set dates
the
Where Condition is:
[OverDueNextYear]![DateOfNextCal] Between [Forms]![Print Advance
Dialog]![From Date] And [Forms]![Print Advance Dialog]![To Date]
And the one that does not work:
[OverDueNextYear]![Department]=[Forms]![Print Advance Dialog]![Select
Dept]
I tried add the above to this one but it kept saying syntax error??
Can you help??


:

Please provide much more detail about the structure of the report and
form.
How are they related? What do you mean by "do not correspond with each
other"? Do you want to print the report while you're viewing the form?
--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/


Hi I want to print a report that has just been updated by the form
but
they
do not corresponed with each other does any one knoww how to get
them
to
connect . My relationships match ect but. Should I put something in
the
Filter box? please help if you can
Jo
 
Back
Top