473,324 Members | 2,248 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Error - Creating Report from combo-box on Form

Hi, need some help please! Here is a quick description of what I'm trying to achieve:

I have an Access 2010 database where I can produce a Report based on my various "products".

It currently lists all products and the relevant info to that product I have added. I have also created a Form with a drop down box of all my "products".

What I want to do is, click on a button next to the drop down box in my Form and select this "product" only to show in my Report. I have used the following to do this:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Report_Click()
  2.  
  3. DoCmd.OpenReport "xxTotSum", acViewPreview, , "[Article No#]=" & Me![ArticleNoBox], acWindowClose
  4.  
  5. End Sub
However, when I then try to 'click' my button, I only get the "Enter Parameter Value" box. I hate this box! Any ideas of what I need to do? Important note, my VBA and Access knowledge is very small - currently learning by doing!

Attached Images
File Type: jpg Error.jpg (49.4 KB, 2820 views)
Nov 1 '11 #1
5 2583
Seth Schrock
2,965 Expert 2GB
Don't forget to use the mandatory code tags around your code.

What I usually do in this situation is to base the report off of a query and the query has the criteria for the ProductID based on the combo box selection. You would then use the after update event of the combo box to open the report like this:

Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenReport "xxTotSum", acViewPreview
This should give the results that you are looking for.

If you need help with the query, just let me know. I'll need to know the field names to be included in the report.
Nov 1 '11 #2
Hi Seth

Thanks for the response. I've got my code like you've suggested, by I still get the "Enter Parameter Value" box.

I think the query and report are correct because these already work. All I want to do is rather than have a report which lists all of my "Products", I want to select one from the drop box on my Form and then press the button to select and produce the Report.

Do you think my query is maybe wrong then?!
Nov 1 '11 #3
Seth Schrock
2,965 Expert 2GB
That would seem to be the only option left. If you could post the SQL code for your query and the name of the combo box and form it is on, I'll check it out.
Nov 1 '11 #4
NeoPa
32,556 Expert Mod 16PB
MiniMike:
However, when I then try to 'click' my button, I only get the "Enter Parameter Value" box
The prompt in the box would be more helpful than the title that's common to all such prompts.

This generally indicates you've mis-spelled or mistyped something. What that is we can't know without your telling us the contents of the box.

You can find more on your general task at Example Filtering on a Form.
Nov 2 '11 #5
NeoPa
32,556 Expert Mod 16PB
MiniMike:
Do you think my query is maybe wrong then?!
After what you've posted in #3 then Yes. That's very likely.

We would still benefit from knowing the exact contents of the prompt box though.
Nov 2 '11 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Xavier MT | last post by:
Hi, I have a problem if somebody can help I appreciate it My VS.NET seemed to work fine and all of a sudden I started to get the "error creating control message" In my aspx page I drag a...
1
by: viditm | last post by:
Hi I keep getting the error "Error Creating Windows Handle" in my application and different places in the code. This occurs only to certain users. Its very random and cannot be reproduced in the...
1
by: timVerizon | last post by:
Hoping someone can help here.. Our application (C#.Net) was receiving IBM.Data.DB2.DB2Exceptions ERROR SQL0904N Unsuccessful execution caused by an unavailable resource. Reason code: '', type...
0
by: Ravi Ambros Wallau | last post by:
Hi: I've created a custom control - a grid that uses Infragistics to display some filters, the grid itself, and some buttons. Well, when using this control directly on WebForm, everything works...
1
by: Harshil | last post by:
Hi All, I am working on Vb.net application with oracle as my database. I have developed reports using crystal report 9. Usually when you open reports directly in crystal report viewer control it...
2
by: mike_li | last post by:
On Window 2000 Professional Server DB2 UDB Level: DB2 code release "SQL07029" with level identifie "030A0105" and informational tokens "DB2 v7.1.0.98", "n040510" and "WR21337". In the...
8
by: ctiggerf | last post by:
I was hopeing someone could help me out here. Been stumped on this one all day. This function 1. Checks uploaded files. 2. Creates two resized images from each (a full size, and a...
0
by: =?Utf-8?B?TWFyaw==?= | last post by:
Users of an in-house application we have written randomly get an Error creating window handle exception, and we've not been able to determine why this happens. A typical callstack is as follows: ...
4
by: =?Utf-8?B?Z3JlZw==?= | last post by:
I am trying to create an instance of a 3rd party COM component, and I'm getting an error. I've opened a ticket with this vendor as well, but I want to approach it from the C# .NET side to make...
1
by: xuki | last post by:
Hi every one! I need your help to solve this problems. I'm trying to creat a wsdl file to a webservice but i'm getting an erros. "Error creating WSDL document:Error creating WSDL: no class...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.