473,396 Members | 2,033 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,396 software developers and data experts.

Updating Controls

Hi there,

I have a report that is opened from a command button on a form. There
is a label on the report called lblProvince. I would like to be able to
change that label based on what the user selected on the form.

For instance, if the user selects "Alberta" from lstProvince, and then
the clicks on the command button (cmdNext) to open the report, I would
like the lblProvince.Caption on the report to say "Alberta."

It gets a little trickier than this but I want to understand the basic
way to do this. Where it gets tricker is this:

The user, on the form, can select a report for a Local Office, a
province, or All Of Canada. If the user has checked off "All Of Canada"
then I want the report's title to say "Canada." If the user selects a
province, then I want the title to say that province. The provinces and
local offices are listed in lstLO and lstProvince.

The "If...Then" is begging for some code, and I noticed that the report
has an open event procedure. In this event procedure, how do I check
form controls? What is the syntax?

Also, what property returns the string value of what is selected in a
listbox?

Thanks for any help! As you can tell, I am fairly new to this.

Steven Stewart

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #1
3 1527
Sounds like you need a combo box on your form.
Then 2 things.
1st the query that feeds your report should have in the criteria field of
1stprovince field
something like [Forms]![yourformname]![yourcomboname]

2nd instead of a label on the report put a text box and the control source will
point to the combo -same as above.
That should get you going
Ask again if you need more
HTH

David B
Hexham UK

Steven Stewart <o6***@unb.ca> wrote in message
news:3f*********************@news.frii.net...
Hi there,

I have a report that is opened from a command button on a form. There
is a label on the report called lblProvince. I would like to be able to
change that label based on what the user selected on the form.

For instance, if the user selects "Alberta" from lstProvince, and then
the clicks on the command button (cmdNext) to open the report, I would
like the lblProvince.Caption on the report to say "Alberta."

It gets a little trickier than this but I want to understand the basic
way to do this. Where it gets tricker is this:

The user, on the form, can select a report for a Local Office, a
province, or All Of Canada. If the user has checked off "All Of Canada"
then I want the report's title to say "Canada." If the user selects a
province, then I want the title to say that province. The provinces and
local offices are listed in lstLO and lstProvince.

The "If...Then" is begging for some code, and I noticed that the report
has an open event procedure. In this event procedure, how do I check
form controls? What is the syntax?

Also, what property returns the string value of what is selected in a
listbox?

Thanks for any help! As you can tell, I am fairly new to this.

Steven Stewart

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 12 '05 #2
If you want to return all records then in an empty field of the query grid in
the top line (where the field names usually are)
put [Forms]![yourformname]![your combo name] and in the lower of the 2 criteria
boxes put - is null.
That way if the combo is blank all records will be returned
HTH
David B

Steven Stewart <o6***@unb.ca> wrote in message
news:3f*********************@news.frii.net...
Hi there,

I have a report that is opened from a command button on a form. There
is a label on the report called lblProvince. I would like to be able to
change that label based on what the user selected on the form.

For instance, if the user selects "Alberta" from lstProvince, and then
the clicks on the command button (cmdNext) to open the report, I would
like the lblProvince.Caption on the report to say "Alberta."

It gets a little trickier than this but I want to understand the basic
way to do this. Where it gets tricker is this:

The user, on the form, can select a report for a Local Office, a
province, or All Of Canada. If the user has checked off "All Of Canada"
then I want the report's title to say "Canada." If the user selects a
province, then I want the title to say that province. The provinces and
local offices are listed in lstLO and lstProvince.

The "If...Then" is begging for some code, and I noticed that the report
has an open event procedure. In this event procedure, how do I check
form controls? What is the syntax?

Also, what property returns the string value of what is selected in a
listbox?

Thanks for any help! As you can tell, I am fairly new to this.

Steven Stewart

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 12 '05 #3
Thanks for your help!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: MLH | last post by:
I have a form, bound to a query. Its RecordSource property is a query named frmEnterLienAmounts. The form has a few bound controls and some unbound controls. The unbound controls are calculated...
3
by: Jon Agiato | last post by:
Hi, I am trying to use a data grid in a web application in which I have three tiers. The DataGrid is not set up to a data source, or a data adapter, so everytime I make a change I send the cell...
1
by: sekisho | last post by:
I'm dynamically adding a column of labels and a column of text boxes to a panel on a webform, based on data returned from an SQL query, which the user builds by selecting options from a few...
0
by: cwbp17 | last post by:
I'm having trouble updating individual datagrid cells. Have two tables car_master (columns include Car_ID, YEAR,VEHICLE) and car_detail (columns include Car_ID,PRICE,MILEAGE,and BODY);both tables...
5
by: Mark R. Dawson | last post by:
Hi all, I may be missing something with how databinding works but I have bound a datasource to a control and everything is great, the control updates to reflect the state of my datasource when I...
0
by: stosh259 | last post by:
Hi everyone, Anyone have a generic procedure to updating different types of controls on a form. I have text boxes and switches (booleans). I would like to loop through all the controls and...
0
by: =?Utf-8?B?YmFrZXJzaGFjaw==?= | last post by:
Unless my app is EXTREMELY simple, I get the cross-threading error message regularly when updating controls on a Windows form. My latest example involves a dll that runs a System.Threading.Timer,...
2
by: toddw607 | last post by:
Hi Everyone! I have a ASP.NET webform that brings data in from SQL Server 2000 and displays it on a page. I want to update the webpage while in IE using the following code: <%@ Import...
0
by: Mike | last post by:
So here's the situation (.NET 2.0 btw): I have a form, and on this form is a textbox among many other databound controls. The textbox is bound to a field in a data table via the Text property. ...
2
by: =?Utf-8?B?TUNN?= | last post by:
I have an asp.net page that contains an update panel. Within the update panel, controls get added dynamically. During partial page post backs the controls within the panel will change. I have 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: 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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.