473,396 Members | 1,743 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.

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 4898
-----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
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
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
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
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
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
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
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
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
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
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
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
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
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...
0
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,...

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.