473,769 Members | 6,034 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with opening a report with only the selections

19 New Member
I need help with opening a report when a button is clicked, but I only want to open the report with the Object I have chosen in the combo box. This is what i have so far:

'If 2 is selected open the report with onlythe selected Vehicles'
ElseIf fraLabelTypeSel ection = 2 Then
DoCmd.OpenRepor t "rptLabels" , acViewPreview, , VehicleMake = Forms!frmLabelS election!cboVeh icle Else
MsgBox "Please make a Selection"
End If
End Sub

Report name = rptLabels
combo box where selections are made = cboVehicle
Form the combo box and option buttons are in = frmLabelSelecti on
i think the bold line is where I am going wrong - have I set it up incorrectly?
Nov 21 '06 #1
3 1506
MMcCarthy
14,534 Recognized Expert Moderator MVP
I need help with opening a report when a button is clicked, but I only want to open the report with the Object I have chosen in the combo box. This is what i have so far:

'If 2 is selected open the report with onlythe selected Vehicles'
ElseIf fraLabelTypeSel ection = 2 Then
DoCmd.OpenRepor t "rptLabels" , acViewPreview, , VehicleMake = Forms!frmLabelS election!cboVeh icle Else
MsgBox "Please make a Selection"
End If
End Sub

Report name = rptLabels
combo box where selections are made = cboVehicle
Form the combo box and option buttons are in = frmLabelSelecti on
i think the bold line is where I am going wrong - have I set it up incorrectly?
Hi Ducky

You haven't made a bad start, essentially in the criteria you have to put the field= in quotes and then & to join the value in the combobox to the statement. I've also surrounded the combobox value with single quotes because I'm assuming its text.

Expand|Select|Wrap|Line Numbers
  1.  
  2.   'If 2 is selected open the report with onlythe selected Vehicles'
  3.   ElseIf fraLabelTypeSelection = 2 Then
  4.     DoCmd.OpenReport "rptLabels", acViewPreview, , "[VehicleMake]='" & Forms!frmLabelSelection!cboVehicle & "'"
  5.   Else
  6.     MsgBox "Please make a Selection"
  7.   End If
  8. End Sub
  9.  
Mary
Nov 22 '06 #2
ducky
19 New Member
I have followed your instructions and it sort of works, I can select the item in the cobobox but when I click the PreviewLabel button, it opens the report with error in it. I think I might have mixed up my fields or forms but I don't know where I went wrong.
Nov 22 '06 #3
MMcCarthy
14,534 Recognized Expert Moderator MVP
I have followed your instructions and it sort of works, I can select the item in the cobobox but when I click the PreviewLabel button, it opens the report with error in it. I think I might have mixed up my fields or forms but I don't know where I went wrong.
What is the SQL of the query behind the report?
Nov 22 '06 #4

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

Similar topics

5
2200
by: Steve Patrick | last post by:
Hi All You guys are my last hope, despite spending money on books and hours reading them I still can not achieve the results I need. I have designed a database in Access 2000 based on 1 table, all has gone very well with one exception. The table is based on applications made by potential customers looking to buy franchise rights to particular locations and as part of the process they are asked to list their preferred locations 1 to 4....
4
2858
by: Alan Lane | last post by:
Hello world: I'm including both code and examples of query output. I appologize if that makes this message longer than it should be. Anyway, I need to change the query below into a pivot table query. I'm having trouble doing it. Help! Here is my code so far: Sub OldRegionQuery()
2
2100
by: Craig B. | last post by:
I am relativly new to access 2000 and am having some trouble with a report. I am not sure what I want to do is something I can do in access. I want to be able to choose from a combo box multiple selections in a form and from those selections present them in a report. For example select a selection A,B, and C out of 9 possible choices. Then show them seperated by a comma in a field in the report. I also want the option of only selecting...
1
1801
by: prabhukalyan | last post by:
Hi all, I am not so good in queries. here is my problem 2 tables to store the received items (fabric)-- inwardmaster, inwarddetails and after some processing (Dyeing) the items were deliverd and stored in tables -- deliverymaster, deliverydetails
6
4997
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing for long running reports. When the processing is complete it uses crystal reports to load a template file, populate it, and then export it to a PDF. It works fine so far....
6
3679
by: Bob Alston | last post by:
I am looking for Access reporting add-in that would be easy to use by end users. My key focus is on selection criteria. I am very happy with the Access report writer capabilities. As far as development of reports, it is certainly fine in my book. But for end-users, with little experience or training, it would be nice to have an easy way to handle various selection criteria, perhaps with relatively stock reports. I see easy to use by...
5
2110
by: Debbiedo | last post by:
I am wondering if I can create an application that when you click on it (say a shortcut), it opens a report parameter box to query a set of parameters, and then opens the report based on these selections without actually opening the access database window. In other words, can I have the end user only see (i.e. have access to) the report in the print preview mode? If so, any suggestions as to how to go about this?
3
5187
by: Paul H | last post by:
I have a transactions table and a balance table that look something like this: tblTransactions TransactionID (PK Autonumber) ClientID TransactionDate TransactionAmount (currency field, values must be >0) CRDR (indicates whether the transaction is a (credit or debit) StatementDate (Date stamp applied when the “Statement” report is run)
12
4046
by: micarl | last post by:
How would i print a report based on criteria selected from several Combo Boxes as well as multiple Multi Select List Boxes, that are located on the same form? I can get one Multi List Box, just not several, to report using this code i found - Private Sub cmdPreview_Click()
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10049
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9997
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8873
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.