A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Using a list or combo box to set the value for a report- one more



 
 
Thread Tools Display Modes
  #1  
Old August 7th, 2009, 11:30 PM posted to microsoft.public.access.reports
jegrau
external usenet poster
 
Posts: 8
Default Using a list or combo box to set the value for a report- one more

Thank you for your response Yes this is exactly what I am trying to
accomplish. Could anyone possibly give me an example of the code to use?
--
John E. Grau
IT Specialist
Bureau of Land Managment
Miles City Field Office
Miles City MT 59301



"Jeff Boyce" wrote:

It may be only a matter of terminology ...

A report in Access is a design for a printed output. As such, it doesn't
have (and can't make sense of) a list of values. That said, folks often
want to run a report for a particular value.

The common approach to handling this is to use a form with a combobox that
lists possible values. After the user selects a particular value, s/he
clicks the command button you have on the form, and the code behind the
command button opens the report for the value selected on the form.

Is this what you're trying to accomplish?

Regards

Jeff Boyce
Microsoft Office/Access MVP

"jgrau via AccessMonster.com" u53353@uwe wrote in message
news:9a35bb67fa7e9@uwe...
How would you create a report that brings up a list or combo box using a
table that would list the values that you would see.
Example: Each employee has a several skill sets for projects. When you
run
the report it would list the 25 skill sets in the skill set table then you
would select one and get the report for who could fill the skill set.

I have it working now but you have to manualy enter the skill set.

There are so many that people can't remember the exact skill set name to
type.


--
John E. Grau
IT Specialist
Bureau of Land Managment
Miles City Field Office
Miles City MT 59301

  #2  
Old August 8th, 2009, 05:12 AM posted to microsoft.public.access.reports
June7 via AccessMonster.com
external usenet poster
 
Posts: 173
Default Using a list or combo box to set the value for a report- one more

Do you need the code to open the report? This example uses the WhereCondition
argument of the OpenReport method to open the report filtered to the desired
skill record. The report's RecordSource must have query of the Skills table.
(I am using aliases, use your actual names)
DoCmd.OpenReport "SkillSetReport", , , "SkillName='" & cbxSkillName &
"'"
You can place this code in AfterUpdate event of the combobox or in Click
event of a button.

jegrau wrote:
Thank you for your response Yes this is exactly what I am trying to
accomplish. Could anyone possibly give me an example of the code to use?
It may be only a matter of terminology ...

[quoted text clipped - 27 lines]
There are so many that people can't remember the exact skill set name to
type.



--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ports/200908/1

  #4  
Old August 8th, 2009, 07:38 PM posted to microsoft.public.access.reports
John Spencer
external usenet poster
 
Posts: 2,364
Default Using a list or combo box to set the value for a report- onem

You are missing an & and a quote mark at the end of the expression.

The following should all be on one line.

DoCmd.OpenReport "skillsetlookup", acViewReport, , "skillset='" &
cbxSkillset & "'"


'================================================= ===
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'================================================= ===


jegrau wrote:
OK I get the following error: Syntax error in string in query expression
'skillset='Air'

Code: DoCmd.OpenReport "skillsetlookup", acViewReport, , "skillset='" &
cbxSkillset '"

  #5  
Old August 8th, 2009, 09:46 PM posted to microsoft.public.access.reports
jegrau
external usenet poster
 
Posts: 8
Default Using a list or combo box to set the value for a report- one m

Ok the code works but now the report does not take the value it still just
brings up the imput box.

Enter Parameter Value
Skillset

In my query i have skillset1 through skillset8 fields with a field
expr1:[skillset]
Criteria as [Skillset1] Or [Skillset2] Or [Skillset3] and so on.

the report works fine if you manualy input the skillset in the enter
parameter box.
--
John E. Grau
IT Specialist
Bureau of Land Managment
Miles City Field Office
Miles City MT 59301



"John Spencer" wrote:

You are missing an & and a quote mark at the end of the expression.

The following should all be on one line.

DoCmd.OpenReport "skillsetlookup", acViewReport, , "skillset='" &
cbxSkillset & "'"


'================================================= ===
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'================================================= ===


jegrau wrote:
OK I get the following error: Syntax error in string in query expression
'skillset='Air'

Code: DoCmd.OpenReport "skillsetlookup", acViewReport, , "skillset='" &
cbxSkillset '"


  #6  
Old August 9th, 2009, 02:23 AM posted to microsoft.public.access.reports
John Spencer
external usenet poster
 
Posts: 2,364
Default Using a list or combo box to set the value for a report- onem


You might be able to use this string (get rid of Skillset parameter in
the query)

"'" & cbxSkillset & " in (Skillset1,Skillset2,Skillset3,..., Skillset8)"

If that doesn't work then you might have to use a more complex expression.

"skillsetlookup", acViewReport, ,
"skillset1='" & cbxSkillset &
"' or Skillset2='" & cbxSkillset &
"' or Skillset3='" & cbxSkillset &
"' or Skillset4='"& cbxSkillset &
"' or Skillset5='" & cbxSkillset &
"' or Skillset6='" & cbxSkillset &
"' or Skillset7='" & cbxSkillset &
"' or Skillset8='" & cbxSkillset & "'"

'================================================= ===
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'================================================= ===


jegrau wrote:
Ok the code works but now the report does not take the value it still just
brings up the imput box.

Enter Parameter Value
Skillset

In my query i have skillset1 through skillset8 fields with a field
expr1:[skillset]
Criteria as [Skillset1] Or [Skillset2] Or [Skillset3] and so on.

the report works fine if you manualy input the skillset in the enter
parameter box.

  #7  
Old August 9th, 2009, 07:06 PM posted to microsoft.public.access.reports
jegrau
external usenet poster
 
Posts: 8
Default Using a list or combo box to set the value for a report- one m

Thank you so much that did the trick
--
John E. Grau
IT Specialist
Bureau of Land Managment
Miles City Field Office
Miles City MT 59301



"John Spencer" wrote:


You might be able to use this string (get rid of Skillset parameter in
the query)

"'" & cbxSkillset & " in (Skillset1,Skillset2,Skillset3,..., Skillset8)"

If that doesn't work then you might have to use a more complex expression.

"skillsetlookup", acViewReport, ,
"skillset1='" & cbxSkillset &
"' or Skillset2='" & cbxSkillset &
"' or Skillset3='" & cbxSkillset &
"' or Skillset4='"& cbxSkillset &
"' or Skillset5='" & cbxSkillset &
"' or Skillset6='" & cbxSkillset &
"' or Skillset7='" & cbxSkillset &
"' or Skillset8='" & cbxSkillset & "'"

'================================================= ===
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'================================================= ===


jegrau wrote:
Ok the code works but now the report does not take the value it still just
brings up the imput box.

Enter Parameter Value
Skillset

In my query i have skillset1 through skillset8 fields with a field
expr1:[skillset]
Criteria as [Skillset1] Or [Skillset2] Or [Skillset3] and so on.

the report works fine if you manualy input the skillset in the enter
parameter box.


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:15 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.