Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / July 2005

Tip: Looking for answers? Try searching our database.

OpenReport - the WHERE clause

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jen - 26 Jul 2005 23:36 GMT
I am trying to create a report that shows information on people assigned to
projects. They can be assigned either as the Assignee or as the Originator of
the project. I have one query that contains the project info (including both
the Assignee and Originator fields). The report is opened from a switchboard,
and the user selects a name from a drop-down list.

Previously, I just wanted the report to show the projects for which the
selected person is the Assignee - that worked great, and my code was as
follows:

DoCmd.OpenReport "Workload", acViewPreview, , "Assignee = '" &
Me!cboAssignee & "'"

Now that I also want to show the projects for which the selected person is
the Originator, I'm thinking I just need an OR statement at the
end...something like this:

DoCmd.OpenReport "Workload", acViewPreview, , "Assignee = '" &
Me!cboAssignee & "'" Or "Originator = '" & Me!cboAssignee & "'"

However, when I try to run this I get a type mismatch error. Ack!

Any suggestions? Can I not use the OR with the WHERE statement in the
OpenReport method?
Ofer - 26 Jul 2005 23:48 GMT
That yours
DoCmd.OpenReport "Workload", acViewPreview, , "Assignee = '" &
Me!cboAssignee & "'" Or "Originator = '" & Me!cboAssignee & "'"

Try this
DoCmd.OpenReport "Workload", acViewPreview, , "Assignee = '" &
Me!cboAssignee & "' Or Originator = '" & Me!cboAssignee & "'"

compare the two and youll see you had ann extra "

> I am trying to create a report that shows information on people assigned to
> projects. They can be assigned either as the Assignee or as the Originator of
[quoted text clipped - 20 lines]
> Any suggestions? Can I not use the OR with the WHERE statement in the
> OpenReport method?
Jen - 26 Jul 2005 23:59 GMT
Thanks Ofer - worked like a charm. I see where my problem was. One of those
"duh" moments!! :)

> That yours
> DoCmd.OpenReport "Workload", acViewPreview, , "Assignee = '" &
[quoted text clipped - 30 lines]
> > Any suggestions? Can I not use the OR with the WHERE statement in the
> > OpenReport method?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.