473,396 Members | 2,129 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.

Check box in access

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?
Thanks
Rad

Mar 10 '06 #1
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
Mar 10 '06 #2
"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.
Mar 10 '06 #3
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
Mar 10 '06 #4
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

Mar 10 '06 #5
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
Mar 10 '06 #6
Great! I think this will work for me! Appreciate your help, Peter

Mar 11 '06 #7

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

Similar topics

4
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")...
1
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...
3
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...
2
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...
7
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. ...
10
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...
1
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...
6
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
1
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,...
55
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
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
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
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
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...
0
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...

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.