i am using access 2000 db, asp forms and vbscript.
here is my question:
i want to get some bits of information (name, email) from a user via a form. I want to then insert this info into an access 2000 database via an asp processing page. this part i have accomplished using one table, one unique user per row, as such:
table 1:
personID (auto-generated) | name | email |
1234 jon j@r.com
now to the problem: in my form, the user will come across a multi-select listbox of colors and can choose all, none, or any number of colors that are available. i want to capture whatever he's chosen, and store those choices somewhere. it didn't make sense to store a list of colors in the first table in one field so i reasoned that i would need a second table dealing with just the colors.
i want to be able to look at this second table, see all the color choices and know that this user (whose personID has been captured from the first table) has affirmatives in some columns and negatives in the rest, like an excel spreadsheet. see? like such:
table 2:
personID | all | none | red | yellow | green |
1234 null null yes yes null
now, just to let you know, my current setup may NOT necessarily be what I need to accomplish my goal, as i know just enough to be dangerous and annoying so if you can understand my ramblings and can see what im trying to do and if you have a better way to set this thing up, I wouuld soooo appreciate it. i'm NOT so deep in that my databse cannot be changed.
Is there a way to make the default value of the <option> tag "False" and then make the "False" a "True" once the user has selected it?
This could work, but how do i do this? do i make the default value False in the <select> or <option> tag or do i do this in access? then, do I really have to loop thru every option or isn't there some wildcard code i could use that looks for true and then backs into the value (ie: red, green, etc.) associated with it? for instance (and you'll see my c++ background here):
Dim colorArray(50)
For i = 1 to Request.Form("color".Count
if colorArray(i).Selected = "True"
{
INSERT INTO Table 2 "TRUE"
WHERE colorArray(i).Value == COLUMN_NAME;
}
Next
Does this make sense?? I am sooo sorry for my newbie-ness
Isn't there a way to test the value of the color chosen against the column header names in access? This would avoid 50 or so case statements or if loops.
For instance, if a user chooses red, green and yellow, and there are column names of red, green and yellow in my access table, isn't there a way to say: if chosen_value == column_name, then insert "True" ???
Please tell me theres a way to test against column names?? thank you soooo much in advance))
here is my question:
i want to get some bits of information (name, email) from a user via a form. I want to then insert this info into an access 2000 database via an asp processing page. this part i have accomplished using one table, one unique user per row, as such:
table 1:
personID (auto-generated) | name | email |
1234 jon j@r.com
now to the problem: in my form, the user will come across a multi-select listbox of colors and can choose all, none, or any number of colors that are available. i want to capture whatever he's chosen, and store those choices somewhere. it didn't make sense to store a list of colors in the first table in one field so i reasoned that i would need a second table dealing with just the colors.
i want to be able to look at this second table, see all the color choices and know that this user (whose personID has been captured from the first table) has affirmatives in some columns and negatives in the rest, like an excel spreadsheet. see? like such:
table 2:
personID | all | none | red | yellow | green |
1234 null null yes yes null
now, just to let you know, my current setup may NOT necessarily be what I need to accomplish my goal, as i know just enough to be dangerous and annoying so if you can understand my ramblings and can see what im trying to do and if you have a better way to set this thing up, I wouuld soooo appreciate it. i'm NOT so deep in that my databse cannot be changed.
Is there a way to make the default value of the <option> tag "False" and then make the "False" a "True" once the user has selected it?
This could work, but how do i do this? do i make the default value False in the <select> or <option> tag or do i do this in access? then, do I really have to loop thru every option or isn't there some wildcard code i could use that looks for true and then backs into the value (ie: red, green, etc.) associated with it? for instance (and you'll see my c++ background here):
Dim colorArray(50)
For i = 1 to Request.Form("color".Count
if colorArray(i).Selected = "True"
{
INSERT INTO Table 2 "TRUE"
WHERE colorArray(i).Value == COLUMN_NAME;
}
Next
Does this make sense?? I am sooo sorry for my newbie-ness
Isn't there a way to test the value of the color chosen against the column header names in access? This would avoid 50 or so case statements or if loops.
For instance, if a user chooses red, green and yellow, and there are column names of red, green and yellow in my access table, isn't there a way to say: if chosen_value == column_name, then insert "True" ???
Please tell me theres a way to test against column names?? thank you soooo much in advance))