473,320 Members | 2,073 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,320 software developers and data experts.

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 "ProblemSubcategory"
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 1935
On Wed, 15 Jun 2005 13:44:10 GMT, "Shannan Casteel via
AccessMonster.com" <fo***@nospam.AccessMonster.com> 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

tblProblemDetails
ProblemID PK
ProblemSubCatID PK

tblProblemSubCats
ProblemSubCatID autonumber, PK
ProblemCatID
SubCatDescription

-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
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 "ProblemSubcategory"
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 UnitSerialNumber 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:

TechnicalProblemsTable:

CaseNumber
SolutionNumber
Date
DealerNumber
UnitSerialNumber
ModelNumber
UnitHours
Status
PrimePart
Solution
ProblemCategory
ProblemSubcategory
Comments
CaseCreatedBy
ProblemCategoryTable

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

ModelNumberTable

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

DealerInformationTable

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...Shannan

Shannan
Nov 13 '05 #3
On Wed, 15 Jun 2005 15:32:41 GMT, "Shannan Casteel via
AccessMonster.com" <fo***@AccessMonster.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_AfterUpdate event write something
like:
lblDealerPhone.Caption = dropcown.column(2)
lblDealerAddress.Caption = dropdown.column(3)
etc., thus pulling that information from the additional columns.

Q2: ProblemSubCategory.
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 TechnicalProblems table will have ProblemCatID (NOT
ProblemCatDescription), and a 1:M link to ProblemCats.
The many Subcats would be stored in a TechnicalProblemsSubcats 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 UnitSerialNumber 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:

TechnicalProblemsTable:

CaseNumber
SolutionNumber
Date
DealerNumber
UnitSerialNumber
ModelNumber
UnitHours
Status
PrimePart
Solution
ProblemCategory
ProblemSubcategory
Comments
CaseCreatedBy
ProblemCategoryTable

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

ModelNumberTable

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

DealerInformationTable

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...Shannan

Shannan


Nov 13 '05 #4
Tom,

I really appreciate your help.

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

ProblemCategoryTable

ProblemCategoryTable

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

ProblemSubcategoryTable

CaseNumber ProblemSubcategoryID ProblemSubcategory
(AutoNumber) 1 Air Cleaner
(AutoNumber) 2 Bearing
(AutoNumber) 3 Belt
.. . .
.. . .
.. . .
(AutoNumber) 141 Accesory Electric
Ok, now how would I relate each ProblemSubcategory 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.com" <fo***@AccessMonster.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.
ProblemCategoryTable: perfect.
ProblemSubcategoryTable: add one more field: ProblemCategoryID.
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 ProblemCategoryTable.ProblemID to
ProblemSubcategoryTable.ProblemCategoryID, 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 ProblemSubcategory matter goes, I guess I just don't understand.
Would the table structure be something like this?

ProblemCategoryTable

ProblemCategoryTable

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

ProblemSubcategoryTable

CaseNumber ProblemSubcategoryID ProblemSubcategory
(AutoNumber) 1 Air Cleaner
(AutoNumber) 2 Bearing
(AutoNumber) 3 Belt
. . .
. . .
. . .
(AutoNumber) 141 Accesory Electric
Ok, now how would I relate each ProblemSubcategory 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
ProblemSubcategoryTable as above with four fields labeled
ProblemSubcategoryID, ProblemSubcategory, ProblemCategoryID, 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...Thanks 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
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,...
3
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...
5
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...
2
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...
13
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...
4
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...
5
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
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...
3
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.