Setting the serverfilter property of a report

E

easyget

I am working in an Access 2000 adp file, and trying to
create a parametrised series of reports (not rocket
science you would think).

I have a report which tries to set the ServerFilter
property to refer to values set by the user in a Form.

The Report has a recordsource called SJGVIEW3 which has
been defined against a SQL database (no problem there, the
connection / view works fine).

The form named SJGVIEWWIZ3 comprises of two combo boxes
named cmbAttribute and cmbRegionID. When I set the
ServerFilter property on the report to the following

(SJGVIEW3.AttributeID = ([Forms]![SJGVIEWWIZ3].
[cmbAttribute])) and (SJGVIEW3.RegionID = ([Forms]!
[SJGVIEWWIZ3].[cmbRegion]))

Access complains about
Line1 incorrect syntax near !
, but what is incorrect about this, can anyone tell me
please.
Debugging for the values of the form's combo boxes in
immediate mode shows that they are properly populated when
the form SJGVIEWWIZ3 is open and values selected.

HELP!!!!!!!!!!!!
 
E

easyget2

As a follow on to this posting which I originally
submitted, but which so far has had no activity against it
apart from this.

If I assign the serverfilter property within the Open
Event of the report to

Me.ServerFilter = "SJGVIEW3.AttributeID = " & (Forms!
SJGView3!cmbAttribute) & " And " & "SJGVIEWWIZ3.RegionID
= " & (Forms!SJGVIEWWIZ3!cmbRegion)

I get the values coming through into the Server Filter as
expected and the report works! The question remains though
why can we not set to this value in the property sheet
itself, without having to resort to Event Procedure code?

I suspect there is something extra I need to do within the
property sheet to help Access recognise the form values,
but what is this doesn't anyone know?

CAN ANYONE HELP WITH THIS PLEASE.
 

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