I have been working on a fix for an issue for the last couple days and haven't gotten anywhere with it. What I am doing is updating a questionnaire. This questionnaire has some answers in drop down, some in radiobutton and some in checkbox. This questionnaire is created created by loading the questions (one table in the database), answers (another table in the database) and the user responses are stored in another table. These are loaded by a select case function. So when I update the default answers in the database and try to view questionnaires with the old answers, I get an error stating the object was not set to an instance. So my question is, how do I allow more than one option to be readable in a select case, but have the same value for radiobuttons, or checkboxes.
Example:
How has the performance of your apprentice been:
X Good
X Bad
(needs to be viewable)
And new answers:
How has the performance of your apprentice been:
X Good
X Could Be Improved
Any insight would be appreciated. The language is VB and the database is SQL
Related
I am working on a multi-choice questions web-app. A user will have to answer 50 to 100 multiple-choice questions. The number of possible answers for each question can differ from 3 to 4 but there is only 1 correct answer.
I would like to create a page stats where the user can come back to the answered questions and see what answer he did select. I am not sure what would be the proper way to do that.
So far I have:
users table
questions table
answers table
I would organize the answers table like this:
In that way:
you will not have columns with null values,
you can have questions with more than 3-4 answers too without adding any extra column
you can have questions with multiple right answers too
Then, you will need a table, which holds the user's answers:
Now, you can easily construct a query, which shows the required data.
The end-user chooses something from a drop-down (it shows description text related to unique ID, but doesn't show the ID)
How would I go about making a further query that uses the user input ID as a parameter for further manipulation?
select x,y
from table1
where k in {1,2,23}
Let's say the user selects 23
select j,l
from table2
where k=23 and {other conditions}
Search for access cascading combobox (at least I think this is what you are looking for). – Andre 20 hours ago
thanks for the tip #Andre that actually solved half of the question. The other half remains Can this be done WITHOUT forms, where one table.column.value is used as the condition or not? I possibly blew this out of proportion, but it will be a useful time-saver for any successive projects with Access... – Nikola Pavlovic
Cascading combobox requires code to requery combobox. Cannot be done in table or query. But if you do not want cascading combobox, but progressive filtering of table or query, also not pracitcal with VBA. – June7 11 hours ago
Alright so the answer to my question is: I can't have what I want without forms, and when I accept having to have forms, the solution is called Cascading combobox Thanks for all your support, people!!! – Nikola Pavlovic 39 mins ago
The issue is resolved. Thanks again to everyone!!!
"meta/background about the use of code and person using it"
1.site built by professional that left company,
2.I am inexperienced but trying/ want to learn,
3.Customer support site for service reps,
................................................
What im trying to do exactly per stackoverflows parameters.
We have a drop down box listing issues that the customer had in a column labeled "issue_type". I can export via csv entire table load onto excel then give to boss for overall review of what the issues were. However data base has a "hide" column. Its function is that when the row is updated the record is kept but the same "job or call" has only one viewable report on site (the most recently updated one). Hide is a boolean. In conclusion I want to export rows that only has the "hide" column Boolean status at 0, AND to only export the columns "customer", and "issue_type". I can seem to only do one or the other. and have researched a minimum of 4 hours to find answer myself and cannot find a syntax to do both at the same time with phpmyadmin.
I dont want an enormous data that is mostly useless but for issue type and customer but i will have to manually delete all the rows with hide = 1?
Thanks anyone 1st attempt question sorry if not correct for stackflow.
SELECT Customer,Issue_type FROM tickets where hide =0;
Elaborating on what is above for anyone that may be looking for a similar answer, SQL supports the "where" clause of which you can when properly syntaxed select many of your columns and their associated strings, booleans, and numbers to = what your looking for. Wildcards I found later for other uses work as well.
Sorry about the self answer but hopefully someone finds this usefull
I am experiencing a problem with mirrored datasets. This situation occured because the data model was switched a few months past and I just got recently assigned to this project, which already had a new application and data model done.
I was tasked with importing all the data from the old MS Access application to the new one and here's where the error has its source. The old data model was written in a way that every dataset was also stored as its mirrored counterpart. Imagine a database table like this:
pk | A | B
1 | hello | world
2 | world | hello
I imported the data via a self made staging process via Excel and VBA coding and that worked fine. The staging was necessary because I wanted to create insert statements and therefore had to map all the old IDs, names, ... to the news ones.
While testing the application after the import was done, I realized that the GUI showed all datasets twice. (The reason for it being shown twice and not once and then once again in mirrored form, is the way we fill the ListBox that shows the results)
I found the reason for that error in the mirrored data and now would like to get rid of it. The first idea I had is rather long and probably over-complicated, that's why I am posting here, in hope of finding a shorter solution.
So, my idea is as follows and would use solely VBA coding:
Filling recordSet with a SELECT * FROM mirroredDataTable
Write a SQL-Statement and check if the recordCount of that statements result is >1 for each record in the recordSet from 1.)
If the resultCount is >1 then one of the IDs in that result is written into a new recordSet or Array
The recordSet / array from 4.) is parsed again and for each ID in there I create a DELETE statement
???
profit
Now I already have an idea for the SQL statement in 2.), but before I begin I'd just like to ensure that there is no "easy" way that I haven't considered yet or just have overlooked.
Would greatly appreciate any help/info/tips you can provide.
PS: It is NOT an option to redesign the whole data model or something among the lines of this (not my decision)
Thanks to #Gord Thompson I was able to solve this issue on a purely SQL basis. See the answer of this subthread for the detailed solution: How to INTERSECT in MS Access?
I am not sure what SQL is exactly, databases I think, would SQL be the thing to use?
I want it so that when a user types into a search box it displays a "did-you-mean" box, that also shows how many other people used that term but I will do later ;)
currently I just want the text to be saved into database (?) and also how many times it's been done.
(new to stackoverflow so sorry if format/whatever is bad)
You just need a three table named something like search_queries which has columns for: id, search_text, and count. Everytime somebody searches just increment the count column where search_text is equal to what they searched for. This is a really broad question though and you need to start by learning the basics and report back here with more specific questions.