Combo box selection to give Specific Information to Query

  • Thread starter LeslieJ via AccessMonster.com
  • Start date
L

LeslieJ via AccessMonster.com

Hello all,

I have a parameter form called frmDocbyDept that filters for the report
Documents by Department. On frmDocbyDept there is a combo box called cboDept,
an invisible text box called txtDept (after the combo box is updated, it
sends the dept id to txtDept which is what the query searches for), and an ok
and cancel button. cboDept consists of fields from the table Department
Holders, and the first column is hidden that shows the identifier, and the
second column shows the department name. When the ok button is clicked the
report is opened up and shows only the documents for the department that was
selected.

There is one department, Logistics, that is actually made up of 4 other
departments now. And documents will now be associated with all five
identifiers. What I would like to be able to do is this:
When Logistics is selected in the combo box, I would like for the text box to
say to search for the five department id's in the query. However, when I
make the text box say 58 or 30 or 33 or 35 or 36 (the five department id's),
the query does not correctly interpret the information and gives me a blank
report.

Every other department is straight forward, and works as expected.

I would appreciate it if anyone has any ideas on how to make the text box
correctly transfer the information over to the query. Thank you in advance.
 
D

Dale Fye

Leslie,

What does the SQL of the query look like now?

--
HTH
Dale

Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.
 
L

LeslieJ via AccessMonster.com

Hi Dale,

The SQL is as follows:

SELECT [Document Information].[Document Identifier], [Document Information].
[Document Number], [Document Version Information].[Document Revision],
[Document Version Information].[Document Amendment], [Document Version
Information].[Document Name], [Document Holder Information].[Department
Holder Identifier], [Document Holder Information].Department, [Document
Distribution Information].[Distribution Number], [Document Version
Information].[Document Status Type], [Document Version Information].[Initial
version]
FROM (([Document Information] INNER JOIN [Document Version Information] ON
[Document Information].[Document Identifier] = [Document Version Information].
[Document ID]) INNER JOIN [Document Distribution Information] ON [Document
Version Information].[Version Identifier] = [Document Distribution
Information].[Document Version ID]) INNER JOIN [Document Holder Information]
ON [Document Distribution Information].[Department Holders Abbreviations] =
[Document Holder Information].[Department Abbreviation]
WHERE ((([Document Holder Information].[Department Holder Identifier])=[Forms]
![frmDocbyDept]![txtDepartment]) AND (([Document Version Information].
[Document Status Type])=1));


Dale said:
Leslie,

What does the SQL of the query look like now?
Hello all,
[quoted text clipped - 21 lines]
I would appreciate it if anyone has any ideas on how to make the text box
correctly transfer the information over to the query. Thank you in advance.
 

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