Queries :: Sql Table To Combo Box
Apr 14, 2015I Would Like to Look up SQL server 2005 table as Tbl1 to my access combo box as combo 1...Total 2 columns in the SQL table as Item & Qty.
View RepliesI Would Like to Look up SQL server 2005 table as Tbl1 to my access combo box as combo 1...Total 2 columns in the SQL table as Item & Qty.
View RepliesI would like to filter a data from a table using a combo box in a form.
The field I would like to filter is called ManufacturersID in MainTable and consist of text and wildcard characters [e.g., Teledyne O&G (ODI), TE Connectivity (Deutsch), etc...], so are the combo strings which are extracted from the table ManufacturersTable. It is not filtering anything. I suspect that the wildcards and spaces are the problem. I also tried to get the combo string to a text box in the form and use it in the query with no success. Additionally, I also tried Like [Forms]![FormName]![textbox] in query criteria but still not filtering...
How can I overcome this?
I am trying to write a query that gets all the telephone hours from a worker done under supervision in a town (qry_svhoursbytown). I have a table that has the workers details, including town (Crisis_support_workers), then another table that has what hours each worker has done (Supervision_Hours). The town is selected from a combo box on the form (frmSearch), under the heading �total hours by location�.
I try and select Bathurst then press recalculate results and in the text box next to supervision hours, it says 66, but if you look in the Supervision_Hours table, there is only 11 hours for the workers that are in Bathurst.
In the query, I have the sum total of the hours field in the Supervision_Hours table, the Town field from the Crisis_support_workers table with the total selected as Where and in that criteria I have [forms]![frmSearch]![ComboTown], then I just have the town field displayed.
What do I need to change to get it to sum correctly?
I have attached the database below so people can take a look.
"I have 1 "main" access file and "Portable".
In the form of main I creat buttom to open and apped the table of other access file-portable.accdb- to the main table!"
I had a problem before about attachment field appending anj JHB solved that problem in this link.
"I have 1 "main" access file and "Portable".
In the form of main I creat buttom to open and apped the table of other access file-portable.accdb- to the main table!"
See that problem and download attachment of that topic.
But I want to append a table with multi select combo box. That combo box field has query from table "list" and i want to append this 2 table (asli & list) to a main database!!!
Attachment instruction:
1-solved pervious problem(OK)
2-problem with combobox query(has ERRROR)
My computer has been updated to 2010 whilst I've been off sick (was 2003 before my accident).
I've created a main table, for devises across the company, and a combo box/selection box based on another table which holds a list of all the "Responsible" employee's aswell as another combo box/selection box for the device location.
So the person entering the information, can enter all the information for a device (torq wrench, socket set etc), who is responsible for it and which department they belong to (where to find the device).
Which all works fine
However, I'd like to create 2 queries, one to enable the user to run a report of all device's allocated with an employee or to be able to run a query for all device's stored in a particular department.
But I have been unable to set the correct query criteria, to enable to query user to be able to selection from a drop down list, which responsible person or location to pull back the correct list.
I was getting an error asking me to set the parenthesis, I have now deleted criteria for both queries, as even if I put [Enter] and type a Responsible person's name exactly as its held on the table, the report comes back blank.
i have a table with three column Named
1-State
2-City
3-Customer
on a form i m placing 3 combo box for each column how can i filter combo 2 from table after select value from combo 1
Ok my problem is this......
I have a form with a field "Property Status" on it. It has 4 possible values -
"C - SHELTERED (with warden charge)";"H - SHELTERED (No warden charge)";"J - WHEELCHAIR SHELTERED (With warden charge)";"M - WHEELCHAIR SHELTERED (No warden charge)";"X - DISCONNECTED"
When the value "X - DISCONNECTED" is selected in the form I want the record to be removed from its existing table and sent to a new table which keeps all the "X - DISCONNECTED" records together.
Any ideas would be greatly appreciated. How would this be coded?
I have a combo box (cboManifestNumber) that is based on the following table:
tblManifestData
ManifestDataIDPK (autonumber PK)
ManifestNumber
RemovedDate
ManifestComments
TsdfIDFK (FK frm tblTSDF)
This table is related to:
tblTSDF
TsdfIDPK (autonumber PK)
I need to be able to update tblManifestData with a new manifest number and manifest comments, along with assigning it a TSDF. how to be able to enter a new manifest number and the associated data without having it create two lines in tblManifestData. I thought that I could enter a new manifest number, then requery the table and form so it shows the complete list of manifest numbers (including the recently entered one) while staying on the newest entry.
I am trying to use a combo box to select the Company in an input record form for my Transactions. In the Transaction table, each record contains the Company ID, but not the company name (I have a relationship with a Company ID primary key in a separate table that has all the companies information).
I would like to be able to select the proper company in the combo box and have the form save the value as the Company ID number with the rest of the input data in a record (it will then refer to the correct company name in the other table if I query it because of the ID key).
I am trying to update a table with the value of a text box on the form where the table to update is as selected from a combo box on the form.I keep getting the following
Error message:
Run-time error 2465
Microsoft Access cant find the field & table_to_update & referred to in your expression..
But really can't see what I've done wrong. Have checked that the table_to_update string does contain the name of the table so guess it must be sql..
Code:
Private Sub Command91_Click()
Dim table_to_update, sql_string As String
table_to_update = Me.Combo49
Debug.Print table_to_update
sql_string = "UPDATE [" & table_to_update & "] SET [" & table_to_update & "].[Project] = """ & Text89.Value & """ WHERE [" & table_to_update & "].[ID] = " & Forms![T_entity]![" & table_to_update & "]![ID] & ""
db.Execute sql_string
End Sub
How can I update (some columns) in a table from the same table based on a Criteria column in the same table.
View 2 Replies View RelatedQuick question for you non-newbs out there...
I have two combo's on the same form, cboFName, cboLName. Trying to make some kind of a cascading combo thing, where when a cboLName is selected, my cboFName will be filled with All the firstname's that share that common last name. All of this data is on the same table, and here's my SQL for the queries at the moment:
SELECT DISTINCT tblContacts.LastName
FROM tblContacts
ORDER BY tblContacts.LastName;
SELECT tblContacts.LastName, tblContacts.FirstName
FROM tblContacts
WHERE (((tblContacts.LastName)=Forms!test!cboLName))
ORDER BY tblContacts.FirstName;
For some reason, the first query for my cboLName (although it works as a stand alone query) gives me a combo box full of blank names. Besides that, can anyone see anything wrong with my code?
Thanks,
Paul
So, I am a total newbie with a question that probably has an easy solution. I have a combo box on a form that is populated from a query. The issue is everytime I click on the combo box, it runs the query to populate it. This wouldn't be so bad if it wasn't querying like 500 employee numbers.
Please help.
Thanks!
Hi,
I've found some similar issues by searching around here but none have been quite the same as my issue.
I have a form that display PC details. It's not set up in any special way and allows additions/edit etc. It refers to one table with all the PC details in it (tblDesktops). We're categorising the PC's by room, so I created a table (tblRooms) and created a field in tblDesktops that looks up the RoomID field in tblRooms.
I've created a combo box on the form that lists the rooms in tblRooms. I want to be able to select a room from the combo box and have it display all the PC's in that room on the current form.
What I've tried;
I created a query called qryDesktops that queries all the desktops. I set the query to look at the combo box so it know what room to look for using;
[Forms]![frmDesktops]![cmbRooms]
I went back to the form and changed its record source to qryDesktops.
From here I'm a little stuck. I run the form, select a room from combo box and obviously nothing happens. I basically don't know how to get combo box to run the query, then refresh the form to show the PC's in the room selected from the combo box.
Note that I also categorise by two other "things" excluding Rooms. There's also tblCategory and tblDepartment which I'd also like combo boxes for search purposes on the form. I'm guessing I'd need three queries for this...qryDesktopsByRoom, qryDesktopsByCategory and qryDesktopsByDepartment. In this case, I'm guessing that clicking on the related combo box would also need to change the forms record source to the needed query? That's a bit further down the line anyway...I'd be happy if it just worked with the rooms combo box at the moment!
Any help much appreciated.
Steve Swallow
i have an access table.i m using Dlookup function for select data in dlookup , i want to sel field as combo box value, and i want when i change combobox value by select from list ,dlookup result will be change .
how can i do it.
I have a combo box that filters records on a subform by user name. I'd like to add an "all" option to the combo box list so that all records regardless of user name may be displayed at once. I have attempted a few approaches to this using a "union query" but am failing to achieve the correct syntax. The query I'm using is this:
Code:
select top 1 0,"**ALL**" from tblauditstaff
union All
SELECT tblAuditStaff.AuditStaffID, [tblauditstaff].[auditstafflastname] & ", " & [tblauditstaff].[auditstafffirstname] AS [Auditor Name], tblAuditStaff.AuditStafffirstName, tblAuditStaff.AuditStaffLastName, tblAuditStaff.AuditStaffResponsible, tblDiscrepancy.DiscrepancyAssignedTo, tblDiscrepancy.DiscrepancyActualCompDate,
[Code] ....
This is the error message I'm getting:
The number of columns in the two selected tables or queries of a union query do not match.
I have two combo boxes in a form. The 2nd combo box is influenced by the selection from the 1st combo box. The record source of the 1st combo box is a table and filters a query OK according to the parameter query I have written.
The 2nd combo box correctly lists data influenced by the selection in the 1st combo box via a record source from the same query, but I am struggling to execute/run the query to filter according to the 2nd combo box. I have tried a second parameter criteria in the same query but when I do that it blanks the selection of 2nd combo box.
I have a form that has a combo box that contains every query in my database. This worked fine until i started having to create cascading queries to return the data I want. How can i populate my combo box with only certain queries in my database.
This is the code I was using to put all queries into my combobox.
FROM MSysObjects
WHERE MSysObjects.Name NOT LIKE "~*" AND
MSysObjects.Type = 5
ORDER BY MSysObjects.Name;
Upon clicking a button or clickin the query in the list, I want the query to run......So the main question is how to I include certain queries in my combo box but not all of them? I do not know SQL or any programming, so as specific as possible will help immensely. Thank you everybody.
hi,
I have a db which uses the data taken from cboInstructors which is used in a query and a produces a list in cboExpertise. This procedure is repeated from cboInstructors for cboAssessors and then cboIVName.
This subform then shows all the modules each student have taken, who taught it, who assessed and who IV'd it. The problem is when one selection is made all the subsequent choices are the same as the cbo above it, i.e. the queries do not run again when a diferent selection is made in cboInstuctors.
I hope this clear.
Help please.
Iain :eek::confused:
howdy all, ive never touched Access until 2 days ago so my experience is
sorely lacking but here is my question:
i want to create a form with a combo box from which a selection is
made (data in the combo box is simply a field list from the same table the query is searching, but
my stumbling block is that i want to include the query in the
same form as the combo box and have it dynamically updates based on the
selection in the combo box.
however for the life of me i cant get the query to update based on the
input (using [Forms]![Form]![Combo1] as the criteria in the query) i have set this criteria in the
CustomerID field of the query (which is also the primary key of the table)
I have re-written this question as I think I managed to cause confusion!
(I really do need help!) My problem involves three tables. The first table is NAMES with an auto-number key field called NamesID.
The second table is a list of Dance Classes, called CLASSES again with an auto-number key field called ClassesID.
The third table is a list of MEMBERS in each dance class.
Obviously, the MEMBERS can belong to many CLASSES, and each of the CLASSES can consist of many MEMBERS.
My aim is to add a new record in MEMBERS by using a ComboBox containing records from the NAMES table.
On the form, I have a combo-box which shows me the list of CLASSES
(ComboClasses). I click on the class.
I then click on the NAMES combo-box, click on a name and want it to appear in the table of MEMBERS for the class shown in the CLASSES combo-box.
The problem
I am selecting the name using “ Select * From NAMES where Names.NamesID=[Forms]![FormName]![ComboNames] (supplied by supersubra) but how do I get the ClassesID into MEMBERS record.
At the moment, if I add a name that member appears in every class, or I have to manually insert the ClassID.
Philip
Where MS Excel is concerned there is very little I can't do and I am now transferring that skill to MS Access and I'm stumbling on this one.
In Excel I would use the INDIRECT formula within the validation and named range to do this but in Access I'm struggling to get this to work.
I have in table TBL_NL_Structure a list of CLIENT_ID with NL_ACCOUNTS against them i.e.
CLIENT_ID....ACCOUNTS
900001.........4000
900001.........4001
900002.........4003
What I want to be able to do is in a sub form and a combo box named ACCOUNT that looks at the active CLIENT_ID and pulls into to combo box JUST the ACCOUNTS set to that CLIENT_ID example if the CLIENT_ID is 900001 is just brings in ACCOUNTS 4000 & 4001.
I can get the whole list to come in to the combo box but not a filtered list.
I have a query that I referenced it to a combo box in a form. In my form I created a combo box which has a list of VendorName and I want my query to opens a VendorName report based on whatever chooses in the combo box so that I use the combo box name in the criteria of the VendorName in my query. Somehow I get an error which says "The Microsoft Office Access database does not organize "[Forms]![Form1]![Vendor_Name]" as a valid field name or expression".
View 10 Replies View RelatedI have a combo box as a value list and all the values apart from one are valid data entries in the table but I want to combine two of the values and then get the query to run if the combined values are selected. The value list is this:
(All);Brand1;Brand2;Brand1 & Brand2;Brand3;Brand4
The criteria in my query is this:
IIf([Forms]![MyForm]![Brand]='(All)',[MyTable]![Brand],IIf([Forms]![MyForm]![Brand]='Brand1 & Brand2',"Brand1" Or "Brand2",[Forms]![FrmCustomListATM]![cbBrand]))
Its the OR part that doesnt work.
Here is what I have in my Query
IIf([Forms]![Report Form]![Combo56]=0,1 or 3,[Forms]![Report Form]![Combo56])
in the combo box I have it setup like this
Yes = 1
No = 3
All = 0
it is pulling for a SQL database and what I am looking to do is if they want them all select 1 and 3 but when I save the Query is changes it to this and doesn't work.
IIf([Forms]![Report Form]![Combo56]=0,([BigAssQuery MTD].[Calc_ID])=1 Or ([BigAssQuery MTD].[Calc_ID])=3,[Forms]![Report Form]![Combo56])
I have a query where I want to use a combo box in the parameter. However, its not working.
SELECT Call_Details.Emp_ID, Call_Details.[Call Status]
FROM Call_Details
WHERE (((Call_Details.Emp_ID)=[Forms]![TTY_ID]![TTY_ID]));
I get this in the Parameter Value Dialoge
Forms!TTY_ID!TTY_ID
Should I be entering this in the criteria field at all? Do I have to build an event to make this work?