473,666 Members | 2,038 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

subqueries in text control boxes

I am programming a client service dbase in access 2000 for a
non-profit health clinic.

I want to create a navigation menu that can show varying numbers of
command buttons with varying captions, driven by data from a table.

1. First, the user selects a "client" by code. This opens a
navigation form which offers command buttons for each of the services
the client is enrolled in, e.g., nutrition, pre-natal care, drug
treatment, etc. There are 10 possible services, so there are ten
buttons, all invisible until a count of client services is established
(from a table, where each of the services has its own index). If the
client has 4 services, then buttons 1 through 4 become visible. So
far, so good. I am able to get that to work.

2. I would like each command button to have a caption that varies
depending on the services. Each time the listing the services is
generated, the records are numbered consecutively. So I would like to
use text control for each command button, where the control source is
a subquery to make something which says,

(SELECT tService.Servic e FROM tService WHERE
(((tsvcCount.co unter)=1)));

(or counter = 2 or whatever....)

Each command button's caption would be driven by the text appearing in
this text control.

So far, I can get the text control to accept the syntax of the
subquery, but when I view the form, the text control just says #Name?

Am I trying the impossible? Is it possible to use a subquery in a
text control?

Gwindor
Nov 12 '05 #1
2 4924
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You are trying to create a Switchboard form. Why not use the
Switchboard Manager to create one instead of building one from scratch.
Or, create a Switchboard form & use it as a template for your menu form.

Acc2K2:
Tools > Database Utilities > Switchboard Manager

Acc97:
Tools > Addins > Switchboard Manager

For future reference: a query in a TextBox's ControlSource will not
return the query's resultset. You may wish to try the DLookup()
function instead. E.g.:

Control Source: =DLookup("Servi ce","tService", "Counter=1" )

See the Access VBA Help article "DLookup Function" for more info.

--
MGFoster:::mgf0 0 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQJaPeIechKq OuFEgEQKYHwCffM hy+fJsj+ux3eX19 3pdqoVXY6EAn2Ht
qoYeRxRLP2PWrrE kPh/iuB0c
=VbxQ
-----END PGP SIGNATURE-----
Gwin wrote:
I am programming a client service dbase in access 2000 for a
non-profit health clinic.

I want to create a navigation menu that can show varying numbers of
command buttons with varying captions, driven by data from a table.

1. First, the user selects a "client" by code. This opens a
navigation form which offers command buttons for each of the services
the client is enrolled in, e.g., nutrition, pre-natal care, drug
treatment, etc. There are 10 possible services, so there are ten
buttons, all invisible until a count of client services is established
(from a table, where each of the services has its own index). If the
client has 4 services, then buttons 1 through 4 become visible. So
far, so good. I am able to get that to work.

2. I would like each command button to have a caption that varies
depending on the services. Each time the listing the services is
generated, the records are numbered consecutively. So I would like to
use text control for each command button, where the control source is
a subquery to make something which says,

(SELECT tService.Servic e FROM tService WHERE
(((tsvcCount.co unter)=1)));

(or counter = 2 or whatever....)

Each command button's caption would be driven by the text appearing in
this text control.

So far, I can get the text control to accept the syntax of the
subquery, but when I view the form, the text control just says #Name?

Am I trying the impossible? Is it possible to use a subquery in a
text control?


Nov 12 '05 #2
Thanks! I will try the dlookup.

The switchboard isn't viable because I want to control which buttons
appear at which times. But dlookup is something I need to learn
anyhow!

Gwindor
On Mon, 03 May 2004 18:29:04 GMT, MGFoster <me@privacy.com > wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You are trying to create a Switchboard form. Why not use the
Switchboard Manager to create one instead of building one from scratch.
Or, create a Switchboard form & use it as a template for your menu form.

Acc2K2:
Tools > Database Utilities > Switchboard Manager

Acc97:
Tools > Addins > Switchboard Manager

For future reference: a query in a TextBox's ControlSource will not
return the query's resultset. You may wish to try the DLookup()
function instead. E.g.:

Control Source: =DLookup("Servi ce","tService", "Counter=1" )

See the Access VBA Help article "DLookup Function" for more info.


Nov 12 '05 #3

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

Similar topics

2
8938
by: John Kreps | last post by:
(acc 2002) I've got six unbound text boxes on a subform that has a white background. Each of those six boxes has an expression that when true, will change its background from white to another color. These text boxes need to go behind a single line of other bound text boxes (which show the actual record). I.e., the purpose of the unbound text boxes w/conditional formatting is to highlight the record/background with one of six colors.
2
286
by: Gwin | last post by:
I am programming a client service dbase in access 2000 for a non-profit health clinic. I want to create a navigation menu that can show varying numbers of command buttons with varying captions, driven by data from a table. 1. First, the user selects a "client" by code. This opens a navigation form which offers command buttons for each of the services the client is enrolled in, e.g., nutrition, pre-natal care, drug treatment, etc. ...
14
4670
by: simonmarkjones | last post by:
Hi, I'm having a bit of trouble editing an old database that was created quite a while ago by someone else. There is a form that lets the user select a member of staff and show details about the training they have had. What im trying to add to this is an email button which emails the person selected - i've managed to be able to do grab the email and create a new email message with the coresponding email adress.
9
6657
by: B-Dog | last post by:
I have a form that has about 10 text boxes on it, they all have to be filled out before submitting is there a quick way to make sure that none are null or do I have to call out each textbox? Say something like textbox1 through textbox10? Thanks
11
16248
by: Edson Peacock | last post by:
I have a report with sub reports, one of the subreports have 12 text boxes that are 2" high and I want them all to grow if one goes to 3" high. If anyone has any suggestions they are very much appreciated. Thanks
5
1603
by: tarscher | last post by:
Hi all, I create a set of text-boxes based on user input: for (int i = 0; i < Convert.ToInt16(keywordsDropDownList.Text); i++) { myTextBox = new TextBox(); myTextBox.Columns = 5; myTextBox.ID = "parameterTextBox"+Convert.ToInt16(i);
1
1522
by: tomlebold | last post by:
Should text boxes or combo boxes be renamed on bound forms? In other word should the Department Name property be the same as Control Source property? I never rename them, but my IT manager seems to think they should be. My IT manager is afraid he will be updating the Department column, when he is trying only display a value in the text box without changing the value in the table.
2
2273
by: jarekz | last post by:
Hello friends. This is my first post here. Please forgive me any mistakes. Could you help me solve the problem that I have in MS Access 2003? I downloaded this template from Microsoft: http://office.microsoft.com/en-us/templates/TC010185811033.aspx and started working on it to modify it for my users' needs. At the bottom of the first page of the tab control I added a few text boxes and closed them within an option group. It's not a real...
11
5156
by: jwessner | last post by:
I have a form (Form1) which contains basic Project data and a subform listing the personnel assigned to the Project as a continuous form. Selecting a person on that project and clicking on a command button will open a new form (Form2). Form2 has two subforms. Both are embedded in the main form. (Subform2 is NOT embedded in subform1.) Subform1 displays records as a continuous form based on the Primary ID of the main form and lists the...
0
8444
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
8356
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8551
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
8639
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7386
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
6198
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
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4368
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2771
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.