Query MS-Access Form ComboBox - sql

as the title suggests I am writing SQL out of excel vba to query Forms contents out of a MS-Access db. The SQL works fine however, the fields where combo boxes are, the SQL returns their index instead of the text field.
I spent some time googling this but most of the results are asking how to display on the form in the combo box, I am just trying to return the text display form the combo box with my SQL.
I will go ahead and say the person who designed this did a bad job, and the tables relating to these drops down have nothing in common(the tables are just a list of the drop down values and ID's).
My question is what is the best way to return this value? Can I join based off the drop down index?

This link should help you get started.
http://access.mvps.org/access/forms/frm0031.htm
Something like this, I presume...
Forms!Mainform.RecordSource

Related

How to select field based from combobox in MS Access

I want a user to be able to choose the field they select from a table through the use of a combo box in an MS Access form. My combo box contains a list of all the field names in the table, and when the user selects one I want that field to be queried. Currently, the general syntax of my code looks like this but doesn't return any values when I run it.
SELECT FORMS![formName]!cboName
FROM tblName;
The form is working fine as far as I can tell so I'm pretty sure the issue is with my SQL but I can't figure out where. Any help is appreciated.

MS Access Binding Textfield to tables

I am currently building a MS Access database as a project #Work.
The Database is fed with a huge, not sorted Table DataQueryExport, and the objective is to create a GUI that makes that huge table workable.
Now to the question:
I have a textfield Comment that is supposed to show a comment to a specific data entry WorkID. The WorkID Is stored in a seperate table called WorkID_Comments which is filled via SQL query. The Table WorkID_Commentshas 2 columns, WorkIDand Comment.
The GUI has a ComboBox WorkID_Combo, where you can select a specific WorkID from the main Table DataQueryExport. This exact value is what is supposed to be used as a reference to show the comment for that WorkID.
TL:DR; I need the Comment Box to show and store the Text I wrote for that Value selected in the ComboBox. How do I get the Textfield to show the Value from the Table WorkID_Comments.Comments where the Value in WorkID_Combo(View ComboBox) is the same as WorkID_Comments.WorkID
I apologize beforehand for any weird capitalizations, I am used to it, German is my main language.
Thank you for reading, I am thankful for any response.
Build a query in the query designer with your needed columns (If I understood it correctly: ID and the Comment).
Then go to your combobox and chose under properties recordsource table/query and your designed query.
Now you can specify which colums should be shown and use the ID as the value in the background.
Then bind another query to your form (here is the text you wrote as column) which is linked to the ID from the combox. Put a textbox in the form and use the column as source.

VBA Userform Listbox into SQL temp table

I have userform in Excel VBA that contains two multiselect listboxes. Essentially its the add/remove concept where the box on the left gives me a lits of analysis names from SQL and you select the ones you want into the box on the right.
What I'm now trying to do is take the information in the list box that the user wants to use and put that into a temp table in SQL so that I can run a query that loops through the values in the temp table.
I was going to create a .csv file save if and then inser the temp table into SQL. However that seemed long winded and made me think there must be a more direct way, however this is beyhond my SQL/VBA skills.
Many Thanks

MS Access 2010 Form with check box per record

I'm trying to create a form that allows my audit team to help identify transactions that need further investigation.
Is the following is possible? If so what would be the best method for accomplishing this? I would like to have a check box in a form for each record that is returned from a query. That check box would then be used to identify records that would be appended to another table.
I've done this in the past for forms linked to temporary tables; however, since this form is linked to a query I think I'm having an issue.
You could add the checkbox to the form and use some VBA code to insert all those rows from the query into another table that have the checkbox checked (Forms!MyForm!myCb = True)

Access 2007 - drop down box in a Report

I need to create a drop-down box so that an employee can select a pre-set reason in the "RE:" field of a Report. There are only two selections that need to be in the box: "personal events" and "lack of adequate notice".
The report itself is already made and there are a number of fields that link back to the database - name, address, specific dates, etc that are already in the report. I've figured out how to make the drop-down box using the combo box function in a form but is there any way I can merge the combo box into the report?
I'm a beginner, by the way so I'm still figuring things out.
Currently your report sits on a query (query get relevant data from the table)
Steps to follow:-
Change the table by adding a column with the two options you just
mentioned above
Add combobox to Form with items as the two options
Adjust your query to use these options as a criteria to change
results returned by the query
Show the results in the report as you are showing right now.
If you have a code already, please post that snippet. So we can help you accordingly.
Some reference for you to get ideas
BUT I HAVE A DOUBT, ARE YOU TRYING TO SAY YOU WANT TO SWTICH BETWEEN TWO REPORTS BASED ON THE USER CHOICE SELECTED IN COMBOBOX?