473,508 Members | 2,343 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.Service FROM tService WHERE
(((tsvcCount.counter)=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 4910
-----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("Service","tService","Counter=1")

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

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

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

iQA/AwUBQJaPeIechKqOuFEgEQKYHwCffMhy+fJsj+ux3eX193pdqo VXY6EAn2Ht
qoYeRxRLP2PWrrEkPh/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.Service FROM tService WHERE
(((tsvcCount.counter)=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("Service","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
8909
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...
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,...
14
4647
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...
9
6649
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...
11
16192
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...
5
1598
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;...
1
1513
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...
2
2260
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:...
11
5140
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...
0
7123
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...
0
7324
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
7382
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...
1
7042
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...
1
5052
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...
0
3193
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...
0
3181
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
418
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...

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.