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 » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Option Group and Combo Box



 
 
Thread Tools Display Modes
  #1  
Old January 25th, 2010, 09:21 PM posted to microsoft.public.access.tablesdbdesign
ScubaDee
external usenet poster
 
Posts: 4
Default Option Group and Combo Box

Can someone help me out here?? I have a combo box with a list of departments
on it...and I have an option group listing the different reports. I want the
user to pick a department and then a report and have it open for that
specific department.

The code works but it pops up the "enter the parameter value" dialogue and I
have to re-type the department...both strange and tedious to the user. Here
is my code

Dim reportname

If Me!Action = 1 Then reportname = "Rpt_PaperworkIncomplete"
If Me!Action = 2 Then reportname = "Rpt_TBD"
If Me!Action = 3 Then reportname = "Rpt_TBD"
If Me!Action = 4 Then reportname = "Rpt_TBD"
If Me!Action = 5 Then reportname = "Rpt_TBD"

Dim stLinkCriteria As String
stLinkCriteria = "[Position]=" & "" & Me![lkp] & ""

DoCmd.OpenReport reportname, acViewPreview, , stLinkCriteria


PLEASE HELP
  #2  
Old January 25th, 2010, 10:42 PM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Option Group and Combo Box

On Mon, 25 Jan 2010 12:21:01 -0800, ScubaDee
wrote:

Can someone help me out here?? I have a combo box with a list of departments
on it...and I have an option group listing the different reports. I want the
user to pick a department and then a report and have it open for that
specific department.

The code works but it pops up the "enter the parameter value" dialogue and I
have to re-type the department...both strange and tedious to the user. Here
is my code

Dim reportname

If Me!Action = 1 Then reportname = "Rpt_PaperworkIncomplete"
If Me!Action = 2 Then reportname = "Rpt_TBD"
If Me!Action = 3 Then reportname = "Rpt_TBD"
If Me!Action = 4 Then reportname = "Rpt_TBD"
If Me!Action = 5 Then reportname = "Rpt_TBD"

Dim stLinkCriteria As String
stLinkCriteria = "[Position]=" & "" & Me![lkp] & ""

DoCmd.OpenReport reportname, acViewPreview, , stLinkCriteria


PLEASE HELP


Well... since none of us can see your tables, or the report, or its criteria,
it's a bit hard to be precise; nor do you indicate where on the form the
Department might be found.

My crystal ball may be a bit hazy, but I'd suggest changing your code to:

Dim reportname As String
Dim stLinkCriteria As String
Select Case Me!Action
Case 1
reportname = "Rpt_PaperworkIncomplete"
Case Else
reportname = "Rpt_TBD"
End Select
stLinkCriteria = "[Position] = '" & Me![lkp] & _
"' AND Dept = '" & Me!Dept & "'"
DoCmd.OpenReport reportname, acViewPreview, , stLinkCriteria

--

John W. Vinson [MVP]
  #3  
Old January 26th, 2010, 01:16 AM posted to microsoft.public.access.tablesdbdesign
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default Option Group and Combo Box

I don't see in your code where you set the value of "reportname"...

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"ScubaDee" wrote in message
...
Can someone help me out here?? I have a combo box with a list of
departments
on it...and I have an option group listing the different reports. I want
the
user to pick a department and then a report and have it open for that
specific department.

The code works but it pops up the "enter the parameter value" dialogue and
I
have to re-type the department...both strange and tedious to the user.
Here
is my code

Dim reportname

If Me!Action = 1 Then reportname = "Rpt_PaperworkIncomplete"
If Me!Action = 2 Then reportname = "Rpt_TBD"
If Me!Action = 3 Then reportname = "Rpt_TBD"
If Me!Action = 4 Then reportname = "Rpt_TBD"
If Me!Action = 5 Then reportname = "Rpt_TBD"

Dim stLinkCriteria As String
stLinkCriteria = "[Position]=" & "" & Me![lkp] & ""

DoCmd.OpenReport reportname, acViewPreview, , stLinkCriteria


PLEASE HELP



 




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 10:07 AM.


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