473,544 Members | 263 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Storing check box selections in a textbox as appended strings

I'll explain as well as possible...not an experienced user...but learning.

I am working on a database for different kinds of problems with machines. A
user will be able to select a problem category from a combo box (i.e. Engine,
Fuel, Electrical, Steering, Power Train, Brakes, Hydraulic, Chassis/Structure,
etc.). Upon the users selection a series of cooresponding check boxes
appears on the form with Problem Subcategories. For instance, if the user
selects brakes in the combo box a series of check boxes appears with
subcategories related to brakes (i.e. Bracket, Emergency Brake, Brake
Calliper, Cable, Disc, Housing, Knob, Lever Assembly, Switch).

To store the selected check boxes I have put a text box near the bottom of
the form that is labeled Problem Subcategory. I want each selected check box
to appear in the text box. For instance, if the user had selected brakes as
the Problem Category and Bracket, Emergency Brake, Housing, and Switch as the
subcategories, I want the text box to read: Bracket; Emergency Brake;
Housing; Switch.

Hopefully, this will appear in the table under the field "ProblemSubcate gory"
as a string that reads just like the text box. If there is a better way of
doing this please let me know. I appreciate any and all help...Thanks alot.
Nov 13 '05 #1
6 1946
On Wed, 15 Jun 2005 13:44:10 GMT, "Shannan Casteel via
AccessMonster.c om" <fo***@nospam.A ccessMonster.co m> wrote:

I'm OK with you displaying the subcats that way, but you probably
don't want to store them in the database like that. If you do, it
makes future queries such as "per category, report how many times each
subcat occurred in the last 6 months" MUCH more difficult.
The best db design depends on the finer points of your requirements;
the below one is just an approximation.

Create the best database design first; then worry about the best user
interface.

tblProblems
ProblemID autonumber, PK
MachineID
ProblemCatID
DateOccurred

tblProblemDetai ls
ProblemID PK
ProblemSubCatID PK

tblProblemSubCa ts
ProblemSubCatID autonumber, PK
ProblemCatID
SubCatDescripti on

-Tom.

I'll explain as well as possible...not an experienced user...but learning.

I am working on a database for different kinds of problems with machines. A
user will be able to select a problem category from a combo box (i.e. Engine,
Fuel, Electrical, Steering, Power Train, Brakes, Hydraulic, Chassis/Structure,
etc.). Upon the users selection a series of cooresponding check boxes
appears on the form with Problem Subcategories. For instance, if the user
selects brakes in the combo box a series of check boxes appears with
subcategorie s related to brakes (i.e. Bracket, Emergency Brake, Brake
Calliper, Cable, Disc, Housing, Knob, Lever Assembly, Switch).

To store the selected check boxes I have put a text box near the bottom of
the form that is labeled Problem Subcategory. I want each selected check box
to appear in the text box. For instance, if the user had selected brakes as
the Problem Category and Bracket, Emergency Brake, Housing, and Switch as the
subcategorie s, I want the text box to read: Bracket; Emergency Brake;
Housing; Switch.

Hopefully, this will appear in the table under the field "ProblemSubcate gory"
as a string that reads just like the text box. If there is a better way of
doing this please let me know. I appreciate any and all help...Thanks alot.


Nov 13 '05 #2
Tom,

I appreciate your thoughts on the matter.

Just to give a little more information... This data base will be used in the
customer support office of a heavy construction equipment manufacturer.
Everytime a customer support rep. answers the phone he will enter information
into the database.

The CaseNumber will be an autonumber.

The SolutionNumber may or may not exist depending on the frequency of the
problem and whether a solution has been written for that problem.

The DealerNumber will be selected from a combo box. After this has been
selected information will hopefully appear on the screen displaying Phone
Number, Address, Etc. from an externally linked table--I don't know how to
get this info to appear either.

The UnitSerialNumbe r will be manually typed by the user, as well as UnitHours,
PrimePart, Comments, CaseCreatedBy.

I guess I was really asking for some code to make some of this stuff work
right, especially the dealer number code and the problem subcategory code.

I've got everything working except those 2 items. I was considering adding a
couple of buttons to the database that said something like "Write Solution...
" and "Search". Any suggestions?
If I understood correctly, suggested 3 tables. I have several tables: listed
below:

TechnicalProble msTable:

CaseNumber
SolutionNumber
Date
DealerNumber
UnitSerialNumbe r
ModelNumber
UnitHours
Status
PrimePart
Solution
ProblemCategory
ProblemSubcateg ory
Comments
CaseCreatedBy
ProblemCategory Table

Engine
Fuel
Electrical
Steering
Power Train
Brakes
Hydraulic
Chassis/Structure
Attachments
Machine Options
Parts
Misc

ModelNumberTabl e

RT60
TF300B
RT360
RT460
RT560
RT660
RT960
MAXI-C
T560
6010
6030
DD-3238

DealerInformati onTable

This table lists the dealer numbers with cooresponding phone numbers,
addresses, etc. It is a linked table.
I have a couple of other minor tables, but nothing significant.

One last question...
Is it really necessary to have a primary key. I've never gotten the purpose
of them.

Sorry to trouble you with this mess...I feel so behind...
Thanks...Shanna n

Shannan
Nov 13 '05 #3
On Wed, 15 Jun 2005 15:32:41 GMT, "Shannan Casteel via
AccessMonster.c om" <fo***@AccessMo nster.com> wrote:

I'll try to address your questions.
Q1: Selecting dealer number displays addl dealer info.
A: In the dropdown list, have additional columns (perhaps hidden) with
Phone etc. Then in the dropdown_AfterU pdate event write something
like:
lblDealerPhone. Caption = dropcown.column (2)
lblDealerAddres s.Caption = dropdown.column (3)
etc., thus pulling that information from the additional columns.

Q2: ProblemSubCateg ory.
A: As I wrote before, the best db design seems to be two tables
ProblemCats and ProblemSubCats in one-to-many (1:M) relation, each
with ID values etc.
Your TechnicalProble ms table will have ProblemCatID (NOT
ProblemCatDescr iption), and a 1:M link to ProblemCats.
The many Subcats would be stored in a TechnicalProble msSubcats table,
which maylook like this:
CaseNumber
ProblemSubcatID
Then on your form you create a subform where the user can select al
Subcat from a dropdown list (2 columns; hidden ID and visible
Description) which draws its data from tblSubcats. The subform would
allow any number of subcats to be selected (similar to the Northwind
sample application's Orders form allows as many OrderDetails as user
may need).

Q3: Primary Key;
A: VERY important. It forces you to declare what (combination of)
field(s) makes up a uniquely identifyable row in the table. This is
one of the cornerstones of relational database design. We prefer a
natural key (e.g. a short alphanumeric ProductCode for the Products
table), but we'll take a surrogate key (e.g. an autonumber ProductID
for the Products table) that is never shown to users but is used for
internal relational purposes. In this case there typically is another
unique index in the table (e.g. on ProductName) because who wants to
drop down a Products list and see two items by the same name...
Also important because without it a table may not be updatable.

-Tom.

Tom,

I appreciate your thoughts on the matter.

Just to give a little more information... This data base will be used in the
customer support office of a heavy construction equipment manufacturer.
Everytime a customer support rep. answers the phone he will enter information
into the database.

The CaseNumber will be an autonumber.

The SolutionNumber may or may not exist depending on the frequency of the
problem and whether a solution has been written for that problem.

The DealerNumber will be selected from a combo box. After this has been
selected information will hopefully appear on the screen displaying Phone
Number, Address, Etc. from an externally linked table--I don't know how to
get this info to appear either.

The UnitSerialNumbe r will be manually typed by the user, as well as UnitHours,
PrimePart, Comments, CaseCreatedBy.

I guess I was really asking for some code to make some of this stuff work
right, especially the dealer number code and the problem subcategory code.

I've got everything working except those 2 items. I was considering adding a
couple of buttons to the database that said something like "Write Solution...
" and "Search". Any suggestions?
If I understood correctly, suggested 3 tables. I have several tables: listed
below:

TechnicalProbl emsTable:

CaseNumber
SolutionNumb er
Date
DealerNumber
UnitSerialNumb er
ModelNumber
UnitHours
Status
PrimePart
Solution
ProblemCategor y
ProblemSubcate gory
Comments
CaseCreatedB y
ProblemCategor yTable

Engine
Fuel
Electrical
Steering
Power Train
Brakes
Hydraulic
Chassis/Structure
Attachments
Machine Options
Parts
Misc

ModelNumberTab le

RT60
TF300B
RT360
RT460
RT560
RT660
RT960
MAXI-C
T560
6010
6030
DD-3238

DealerInformat ionTable

This table lists the dealer numbers with cooresponding phone numbers,
addresses, etc. It is a linked table.
I have a couple of other minor tables, but nothing significant.

One last question...
Is it really necessary to have a primary key. I've never gotten the purpose
of them.

Sorry to trouble you with this mess...I feel so behind...
Thanks...Shann an

Shannan


Nov 13 '05 #4
Tom,

I really appreciate your help.

As far as the ProblemSubcateg ory matter goes, I guess I just don't understand.
Would the table structure be something like this?

ProblemCategory Table

ProblemCategory Table

ProblemID ProblemCategory
1 Engine
2 Fuel
3 Electrical
4 Steering
5 Power Train
6 Brakes
7 Hydraulic
8 Chassis/Structure
9 Attachments
10 Machine Options
11 Parts
12 Misc

ProblemSubcateg oryTable

CaseNumber ProblemSubcateg oryID ProblemSubcateg ory
(AutoNumber) 1 Air Cleaner
(AutoNumber) 2 Bearing
(AutoNumber) 3 Belt
.. . .
.. . .
.. . .
(AutoNumber) 141 Accesory Electric
Ok, now how would I relate each ProblemSubcateg ory to each ProblemCategory ?
In other words, how does the database know that Air Cleaner is an Engine
Problem?

This stuff is way, way, way over my head.

Thanks for all your help you've been great,

Shannan

--
Message posted via http://www.accessmonster.com
Nov 13 '05 #5
On Thu, 16 Jun 2005 14:32:58 GMT, "Shannan Casteel via
AccessMonster.c om" <fo***@AccessMo nster.com> wrote:

Good for you for at least trying. I guess the marketing propaganda out
of Redmond doesn't tell you some of this stuff is HARD.
ProblemCategory Table: perfect.
ProblemSubcateg oryTable: add one more field: ProblemCategory ID.
Your #1 gets a value of 1, and #141 a value of 3. That's how you tie
things together in a relational database design. Don't forget to open
the Relationships window, put these 2 tables on the design surface,
and drag-n-drop ProblemCategory Table.ProblemID to
ProblemSubcateg oryTable.Proble mCategoryID, and check the box to
enforce referential integrity. Leave cascade updates unchecked, and
check cascade deletes. Once you do that, and carry the same idea
forward throughout your db, your db design is in the top 25% of all db
designs.

-Tom.

Tom,

I really appreciate your help.

As far as the ProblemSubcateg ory matter goes, I guess I just don't understand.
Would the table structure be something like this?

ProblemCategor yTable

ProblemCategor yTable

ProblemID ProblemCategory
1 Engine
2 Fuel
3 Electrical
4 Steering
5 Power Train
6 Brakes
7 Hydraulic
8 Chassis/Structure
9 Attachments
10 Machine Options
11 Parts
12 Misc

ProblemSubcate goryTable

CaseNumber ProblemSubcateg oryID ProblemSubcateg ory
(AutoNumber) 1 Air Cleaner
(AutoNumber) 2 Bearing
(AutoNumber) 3 Belt
. . .
. . .
. . .
(AutoNumber) 141 Accesory Electric
Ok, now how would I relate each ProblemSubcateg ory to each ProblemCategory ?
In other words, how does the database know that Air Cleaner is an Engine
Problem?

This stuff is way, way, way over my head.

Thanks for all your help you've been great,

Shannan


Nov 13 '05 #6
Tom,

Ok...I've done everything you've said...and so far it looks like its going to
work. Thanks for your help. Last question...I promise. Now that I have my
ProblemSubcateg oryTable as above with four fields labeled
ProblemSubcateg oryID, ProblemSubcateg ory, ProblemCategory ID, ProblemCategory ,
I need a way of allowing the user to select more than one value from the
Problem Subcategory as long as all his/her choices are within the respective
Problem Category. I would prefer to have a combo box with the Problem
Category, and upon selection a group of check boxes appear for that
respective category, but I don't know how to get the database to store all
those check box selections...or even one of those selections for that matter.
Any suggestions on this would be greatly appreciated...T hanks for all your
help...,

Shannan

--
Message posted via http://www.accessmonster.com
Nov 13 '05 #7

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

Similar topics

3
2115
by: MS | last post by:
What's the best way to "store" and display a value in a text box that changes from day to day. An example of this would be where the name of the user is manually typed in after using the datbase, along with (say) the date. ATM, I have a table with (say) 4 fields. Each field is linked to a column in a combo box. The combo box is invisible on...
3
2580
by: Shannan Casteel via AccessMonster.com | last post by:
I have three main tables. The first is the table that my main form will be based on. This is where the user will enter all the data. The table is called TechnicalProblemsTable. It looks like this: I can't fit it on the screen, so I'll just list the field headings vertically. CaseNumber-pk SolutionNumber Date
5
3969
by: MLH | last post by:
This is one for you gurus. Someone has undoubtedly already done this. How difficult would it be to recurse all command buttons and textbox controls on all forms, appending an incrementing number to the end of their Caption property strings? Say I have 10 forms with 10 such controls each, I would like to have " (001)" - " (100)" appended to...
2
1606
by: Oliver Block | last post by:
Hello, sometimes one can see that on some site there are query strings appended to a URL even if the requested document is of .html form. What sense does that make? I couldn't find anything in the w3 recs. Best Regards, Oliver
13
3313
by: WALDO | last post by:
I have a .Net TextBox (TextBoxBase, really) in which I am appending about 20 lines of text per second. I use the AppendText() method to accomplish this. This is a great substitute for taking the Text property and concatenating it... Me.tb.Text &= newText ' Instead use Me.tb.AppendText(newText) ....ultimately setting the SelectionStart...
4
1712
by: keithsimpson3973 | last post by:
Does anyone know of a way to take the contents of a multiline textbox from a form, then when I open another form with a listbox on it, have the items matching the textbox items be higlighted in the listbox? Example: User opens form with textbox that has 2 items in it, say "BDU1" and "BDU2". He clicks on an Edit button and open a form that has...
5
2790
by: kid | last post by:
Hi, I have 5 checkbox elements, i.e: ( 1 ) a ( 2 ) b ( 3 ) c ( 4 ) d ( Check/Uncheck all )
2
1446
by: vivsonavane | last post by:
hi all i am making a web page which has a username to register but i dont want to put any password for completing registration. the idea is when user makes any decision and select ok one dialog box should apper on the screen with two textbox for entering and reentering passwords. the main thing is as soon user enters the password...
3
3195
by: =?Utf-8?B?SmFtZXMgUGFnZQ==?= | last post by:
I've a multiview with 3 views. on view 2 the user is presented with a check box list (items from database) at view 3 the user can review their selections and, either post to the database or go back and amend their selections (all selected data is held in an extensive profile including several list items). The problem is going back from view...
0
7424
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...
0
7365
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...
0
7607
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7376
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...
0
7709
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...
0
5909
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...
1
5297
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...
0
3415
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...
1
1841
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.