I am stuck with this problem. I need to create form with checkbox that
must be populated dynamically from a table. For example, if I have a
table called Fruits, and the values are "Apple", "Orange", "grapes", I
need a form with 3 check box (should be able to view all in the same
screen). If i add one more fruit, then the form must automatically
change to reflect this. How would I go about doing this?
Thanks
Rad 6 9156
Per rad: I am stuck with this problem. I need to create form with checkbox that must be populated dynamically from a table. For example, if I have a table called Fruits, and the values are "Apple", "Orange", "grapes", I need a form with 3 check box (should be able to view all in the same screen). If i add one more fruit, then the form must automatically change to reflect this. How would I go about doing this?
How about a little more detail on what's underneath.
So far, it's sounding like a combo box or radio button group.
Not checkboxes because the property values are mutually-exclusive. i.e.
something cannot both Apple and Orange.
--
PeteCresswell
"rad" <rv******@vt.edu> wrote in
news:11*********************@p10g2000cwp.googlegro ups.com: I am stuck with this problem. I need to create form with checkbox that must be populated dynamically from a table. For example, if I have a table called Fruits, and the values are "Apple", "Orange", "grapes", I need a form with 3 check box (should be able to view all in the same screen). If i add one more fruit, then the form must automatically change to reflect this. How would I go about doing this?
Thanks Rad
There are several approaches to this, none of which work. ;^)
One way is to use a subform disguised to look like a row of
labels and checkboxes.
Another is to put a bunch of hidden labels and checkboxes and
use code to scan the fruits table, add the fruit name to the
label and unhide the label and checkbox each time you open the
form.
Both these have the advantage of removing the box when the value
is removed from the fruit table.
The issue has to do with the purpose of the checkbox, whether
it's to store true or false in a table, to control a filter in a
report, etc.
These are not fun things to code. Better you use a multiselect
listbox.
--
Bob Quintal
PA is y I've altered my email address.
Per (PeteCresswell): So far, it's sounding like a combo box or radio button group.
And, of course, a combo box would eliminate the issue of adapting
to added values in the range.
In the table you store something like FruitTypeID.
Then you have a lookup table like tlkpFruitType:
FruitTypID FruitTypeName
--------- -------------
1 Apples
2 Oranges
3 Pears
The combo box's .ControlSource=FruitTypeID in the main table.
The combo box's .RowSource = tlkpFruitType.
--
PeteCresswell
A combo box sounds like a good idea, but may not fit what I have in
mind.
I have 2 tables. One is the fruits table that Peter listed
FruitTypID FruitTypeName
--------- -------------
1 Apples
2 Oranges
3 Pears
Another is the list of users and the fruits of their choice.
User FruitTypID
------- ----------------
Rad 1
Peter 1
Peter 2
Now, I need a form that would have one user at a time, and list all the
available fruits, and have only the fruits of choice, checked.
ie. The form for Rad will have 3 check boxes,: Apple, Orange, Pear. But
only Apple will be checked.
For Peter, both Apple and Orange will be checked. This form must
provide the capability to alter the fruits of my choice. So Rad can
uncheck Apple and select pear and orange instead, etc.
Hope I am making sense!!
Thanks a lot
Rad
Per ra***************@gmail.com: Now, I need a form that would have one user at a time, and list all the available fruits, and have only the fruits of choice, checked.
ie. The form for Rad will have 3 check boxes,: Apple, Orange, Pear. But only Apple will be checked. For Peter, both Apple and Orange will be checked. This form must provide the capability to alter the fruits of my choice. So Rad can uncheck Apple and select pear and orange instead, etc.
You need a third "link" table between tblUser and tblFruit.
tblUser ==> tblUserFruit ==> tlkpFruit.
tblUser:
---------
UserName
UserNumber (just an AutoNumber PK)
tblUserFruit:
--------------
UserNumber
FruitID
tlkpFruit:
-------------
FruitID
FruitName
If JoeUser (whose UserNumber is 14) likes apples and pears, tblUserFruit will
have two records in it for him:
14 01
14 03
frmUser will have a subform on it: frmUserFruit, whose .RecordSource
is tblUserFruit and whose subform linkage specify UserNumber. Either that or
..RecordSource = a query with a criteria of UserNumber=frmUser.txtUserNumber.
--
PeteCresswell
Great! I think this will work for me! Appreciate your help, Peter This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Si |
last post by:
Hi Guys
I am using this code to execute an Access VBA function from ASP:
strDbName = strDataSource & "data\webjobs.mdb"
Set objAccess = Server.CreateObject("Access.Application")...
|
by: Martin |
last post by:
Hello Everybody!
I have a POLINE table on a SQL Server 2000 DB. Before I update the
record I need to check that either field, STORELOC or WONUM has data
on it. If both fields are NULL I would...
|
by: RAD |
last post by:
I am working with an evaluation copy of SQL Server 2000 for the first
time; my DB experience lies with MS Access.
I have a simple table in SQL Server (tblCompany) that has a field
called...
|
by: Ben |
last post by:
My current project requires me to create part of a form that is
created on the fly. The project consists a list of entries to an
event. The name and address and such is easy. The design is detup so...
|
by: Neil |
last post by:
I have a check box on a form that's bound to a function that returns a
True/False value. When the user clicks on the check box, I run some code
through the MouseDown event. Everything works fine.
...
|
by: Wolfgang Kaml |
last post by:
Hello All,
I have been working on this for almost a week now and I haven't anything up
my sleeves anymore that I could test in addition or change....
Since I am not sure, if this is a Windows...
|
by: scprosportsman |
last post by:
Please help guys, i am trying to set up a database here at work and im
fairly new to access in terms of writing functions and queries and
stuff. I have 2 different places on my design that will...
|
by: Fred W. |
last post by:
When my application starts I need to check folder permissions to ensure they
have "Full Control" before I let them proceed on. How can I check this
permission. Thank you, Fred
|
by: =?Utf-8?B?R2FuZXNoIE11dGh1dmVsdQ==?= |
last post by:
Hello All,
Our application write logs to a file in a folder. Before our application
starts writing to that file, I want to check if the current user has write
access to that file, for example,...
|
by: lovecreatesbea... |
last post by:
Do you check all error conditions for all library calls in you code?
Is it necessary to check all errors? Is it convenient to check all
errors (or how to make code clean and readable with mass of...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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...
|
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,...
|
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...
|
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,...
|
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...
|
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: 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...
| |