473,394 Members | 1,806 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,394 software developers and data experts.

programming control source help..

Hi!
Can a control source for a report be dynamic and programmed based on a form selection?

I have a form where a user selects one of 5 cities in a combo box. This should then display a report displaying the records (3 fields) based on the city chosen.

The 3 fields are currently in a query which has 15 fields again based on the city.

As an example, the query has fields: Toronto, Toronto1, Toronto2, Montreal, Montreal1, Montreal2, Vancouver, Vancouver1, Vancouver2, etc...

If the user selects Montreal on the combo box, I want the report to display the fields Montreal, Montreal1 and Montreal2 in the detail.

Is this possible?
Thx.
May 7 '09 #1
3 1432
beacon
579 512MB
Hi ann,

Just to make sure I'm understanding you correctly...you want the user to be able to select a value from a combo box and then have the report generated based on the value selected, right?

I don't think you actually need to modify the control source of any control. You just need to setup your parameters for your query based on the combo box on your form and then have your form call the report. When you do this, your report will use the query you assign as the record source, which will then use the parameter on your form as the selection criteria.

Check out this link for details (with pictures!): http://www.fontstuff.com/access/acctut08.htm

The only thing to keep in mind that I would do differently than the web site is to replace
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenQuery
with
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenReport
and make sure that the underlying query is the record source for the report.

If this doesn't make sense, let me know and I can go into further detail.

Ciao
May 7 '09 #2
OldBirdman
675 512MB
http://bytes.com/topic/access/insigh...ble-structures might also be a good place to start.
I looks like there is a table (or query) with the following fields:
Expand|Select|Wrap|Line Numbers
  1. Toronto
  2. Toronto1
  3. Toronto2
  4. Montreal
  5. Montreal1
  6. Montreal2
  7. Vancouver
  8. Vancouver1
  9. Vancouver2
  10. ....
  11.  
If nothing else, this design lacks flexibility, and may cause future problems. The query being requested will have to be built dynamically using VBA coding to change the fields being selected. Not the same as selecting records for a city.
May 7 '09 #3
NeoPa
32,556 Expert Mod 16PB
Hi. Welcome to Bytes!

I'm a little unsure what you actually mean in your question (As OldBirdman says the record structure appears bizarre, if that's what you really mean).

Check out Example Filtering on a Form and let us know if you still feel you need more help.
May 8 '09 #4

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

Similar topics

2
by: RSB | last post by:
Hi Every one, I am currently using Visual Studio .Net and trying to open a project from SourceSafe and once i open the project for the first time i get the following error/warning... "The...
15
by: Earl Higgins | last post by:
The company where I work as a Senior Software Engineer is currently revamping their (1991 era) "Programming and Style Guidelines", and I'm on the committee. The company, in business for over 20...
2
by: Juuso Hukkanen | last post by:
Language is quite good, if you don't learn the language syntax in 30 minutes complain and flame. t3d(TM) in a nutshell: -Languages main documentation is two pages (presented on the last two...
1
by: Vladimír Kolesnik | last post by:
Hi, there we need help concerning setting project under source control. We want to have a project on the server, and developers in the local network working on this project. We decided to use...
9
by: TCORDON | last post by:
I have a user control that contains 2 image buttons, when you click one of them, both must change the image source, the thing is that the first time you click any one of them the page appears to do...
63
by: John Salerno | last post by:
I know there's a request for a good IDE at least once a week on the ng, but hopefully this question is a little different. I'm looking for suggestions for a good cross-platform text editor (which...
11
by: -D- | last post by:
How can I turn the visibility of the xml control on or off? <%@ Control Language="c#" AutoEventWireup="false" Codebehind="TopNavBar.ascx.cs" Inherits="compass.user_controls.TopNavBar"...
4
by: amcasperforu | last post by:
Hi guys, Greetings! Here are my questions. (I'm pretty new hope you can guide me) 1. Can we use DataGriedView control to include a unbind and bind source (can we mix them)? 2. Im sure you...
29
by: Martin Schmied | last post by:
Dear folks I'm looking for good sites/material for this topic: Introduction to programming, using Javascript. So, not introduction to programming *in" Javascript. Well, I guess this would be...
7
by: RichB | last post by:
I am trying to get to grips with the asp.net ajaxcontrol toolkit, and am trying to add a tabbed control to the page. I have no problems within the aspx file, and can dynamically manipulate a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...

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.