Query Results In ComboBox

Jun 6, 2005

:( I have such problem : my query works right, but in ComboBox I got results with wrong sort.
Query results is:
Street 8
Street 8a
Street 10
Street 10/12

But in ComboBox data views such:
Street 10/12
Street 10
Street 8a
Street 8

Please help me!

View Replies


ADVERTISEMENT

Show Current Record Value From Table In Combobox In Addition To Query Results

May 3, 2015

I have a table, with a related value in another table. E.g. A Items table with a batch value from another table.

I have a form to enter how many of these items has been used and from which batch number they belong.

The batch number is from a dropdown, and batches can be finished(exhausted) and marked such in the table so they no more show in the dropdown.

All this works fine, until, I go back to a entry which was from a batch that has been finished. The combobox is empty although the (Already finished) batch number is mentioned in the table. This is perfectly normal as my query for the combobox is :

Code:

SELECT ItemBatch.ItemId, ItemBatch.ItemBatchNumber, ItemBatch.Finished, ItemBatch.ItemName
FROM ItemBatch
WHERE (((ItemBatch.Finished)=False)
AND ((ItemBatch.ItemName)=[Forms]![ItemMasterForm]![ItemDataSheet].[Form]![ItemName]));

What I want is to show the current batch number as well. I tried to make this query get the current value, but wasn't successful. I tried to make a calculated field based on the dropdown and show its value.

Is there any way I can show the batch number in the datasheet? I have to use a datasheet and not a form, because there will be many sub records for the main form, and having a form will be very uneasy.

View 3 Replies View Related

Combobox Results Incomplete

Apr 19, 2006

I have cascading comboboxes on my search form. The first selects a year, the second all hospitals with patients who had visits in that year, and the third is supposed to be populated with all patients who had visits at that hospital in that year. When I click on the third combobox, the results are incomplete. Some of the patients fitting the criteria are listed but not all of them. On each run there may be a different number of patients. If I just run the query by itself, all of the patients are listed. The combobox rowsource is:

SELECT DISTINCTROW [PatientNbr] & " - " & [PatientName] & " - " & [ServiceYear], [PatientNbr]
FROM qryFindPatients
ORDER BY [PatientName], [ServiceYear];;

The query (qryFindPatients) is:
SELECT tblSUR2941Master.ServiceYear, tblSUR2941Master.ProviderNbr, tblSUR2941Master.ProviderName, tblInterPatients.PatientName, tblSUR2941Master.PatientNbr
FROM (tblSUR2941Master INNER JOIN tblInterPatients ON tblSUR2941Master.PatientNbr = tblInterPatients.MedicaidNbr)
INNER JOIN tblInterPatientsEntries ON tblInterPatients.MedicaidNbr = tblInterPatientsEntries.MedicaidNbr
WHERE (((tblSUR2941Master.Sampled)="1"))
GROUP BY tblSUR2941Master.ServiceYear, tblSUR2941Master.ProviderNbr, tblSUR2941Master.ProviderName, tblInterPatients.PatientName, tblSUR2941Master.PatientNbr
HAVING (((tblSUR2941Master.ServiceYear)=[Forms]![frmIntermediateVisits]![txtRevYear]) AND ((tblSUR2941Master.ProviderName)=[Forms]![frmIntermediateVisits]![cboFacility]))
ORDER BY tblSUR2941Master.ServiceYear, tblSUR2941Master.ProviderName, tblInterPatients.PatientName;
How can I get all the patients to show up in the combobox?
Thanks in advance.

View 1 Replies View Related

What Happens When A Combobox Search Has Multiple Results

Jan 22, 2007

When you put a combo box to search the values in a form what happens if there are more than one (in my case) name that matches the criteria. ie: if you search for Smith and there are 10 people with the surname of Smith it brings up the first record. is there a way of doing adding a "search again' function so you can look for another Smith?

View 3 Replies View Related

Modules & VBA :: Populate Combobox From Listbox Results

Jun 12, 2015

I have a list of staff that have a conflict of interest with a particular entity. As a result, these staff are not allowed to interview these entities.

I have a query that matches all staff with their respective entities that they have a conflict of interest with (CoI) and that is functioning correctly.

When the form loads to add an interview, there is a listbox that pulls all the people who are not allowed to do an interview with that particular entity. That is also working correctly.

I have a subform, that is a continuous form, which will allow the user to add staff, one at a time, via a drop down box. These people are stored in their own table with a FK Id to the interview table. This also works correctly.

How to filter the combobox on the subform to exclude the people in the listbox.

Here is what I have tried, loosely based on what I have found on Google and researching here. I am 100% sure it is not working correctly, but what I am missing.

The query the listbox is based on has 3 colums, the ID, the Name, and the business contract number.

Code:
Private Sub Form_Load()
Dim strSource As String
Dim i As Integer
For i = 0 To Me.lstCoI.ListCount - 1

[Code] ....

In the immediate window, I get the following result:

SELECT [staff] FROM lutStaff WHERE Staff <> name1
SELECT [staff] FROM lutStaff WHERE Staff <> name2
SELECT [staff] FROM lutStaff WHERE Staff <> name3
SELECT [staff] FROM lutStaff WHERE Staff <> name4
SELECT [staff] FROM lutStaff WHERE Staff <> name5
SELECT [staff] FROM lutStaff WHERE Staff <> name6

The issue is that the box is not filtering all the names out of the list it is built on. It is only filtering out the last name.

Obviously I need to save the results for comparison, but I am at a loss on how to do that.

View 10 Replies View Related

Query Results Minus Query Results = New Query?

Apr 1, 2008

I used to queries ,1 to get items that are taken ( its all about sign in sign out for equipment) and other query is list of all items.
How can i make 3rd query which will give me all but taken items from query1?
(of course items from query 1 are in query2)
thx in advance

View 7 Replies View Related

Forms :: Update Row-source Of Combobox Based On Value Selected On Another ComboBox?

Apr 26, 2015

I am trying to use a combobox called Manufacturer to select which table the combobox called Model gets it's rowsource from using the code below.

Code:

Private Sub Manufacturer_AfterUpdate()
If (Me.Manufacturer.Value = "Siemens") Then
Me.Model.RowSourceType = "Table/Query"
Me.Model.Recordset = "SeimensTable"
Me.Model.RowSource = "SELECT Model FROM SeimensTable"
Else
If (Me.Manufacturer.Value = "Samsung") Then
Me.Model.RowSourceType = "Table/Query"
Me.Model.Recordset = "SamsungTable"
Me.Model.RowSource = "SELECT Model FROM SamsungTable"
End If
End If
End Sub

But when I run the form and select Manufacturer. Combobox Model remains empty. tell me what I'm doing wrong?

View 5 Replies View Related

Queries :: Join Results Of Unmatched Query With Matched Query To Include Null

Mar 24, 2013

I am trying to do the good 'ol sales report (query) to include customers with no sales.

I have a customers table, account number table, sales table & sales (line) detail table. (all linked in that order)

If I run a query to show customers (in the customer table) with account numbers, that works

An unmatched query to show customer without an account number works (but of course the unmatched account number field isn't shown).

How can I get the two two be shown together with the "unmatched" having a null or 0 for their account number?

I am guessing in principle, the resulting solution can be modified to show customers without sales alongside those with sales?

View 3 Replies View Related

Queries :: Update A Query Based On Results From Another Query Using Count Function

Apr 2, 2013

I run a physical therapy office and patients come in for treatment either 3, 4 or 5 times per week. My database is used to track these frequencies (among other things).

I have 3 queries which count how many patients come in 5, 4 and 3 times/week.

In my main table I have fields called "how many 5's", "how many 4's" and "how many 3's".

I have tried to design an update query which will update those fileds in my main table to reflect the counts in the 3 queries mentioned above.

(I'm not using SQL view, I'm using the query design view)

In the "update to:" row, I use the Build function and locate the count I'm looking for.

Problem: when I run the query I get the error: Operation must use an updateable query.

View 3 Replies View Related

Saving Contents Of Combobox As String, And Inputing In Another Combobox

Jan 13, 2005

How would I modify multiple comboboxes in subforms at the same time. For example.. In main form ComboboxA user selects 1992, Combobox1 in subform1 is also changed to 1992, as well as Combobox2 in subform 2.

Whats the best way to do this?

View 2 Replies View Related

Self Generating Query String Based On Query Results?

Jan 3, 2008

Here's my problem. I need to generate a report that says how much of each individual product was produced and as well as the total produced for a specified category in a time period. Something like the following:

05 Catagory A: 02 Product AA, 01 Product AB, 02 Product AC
10 Category B: 07 Product BA, 03 Product BB
04 Category C: 01 Product CA, 01 Product CB, 01 Product CC, 01 Product CD

etc...

I currently have a query that queries a database and pulls out all products that were produced in a specified period and the categories they belong to and dump them into a local access table. Now what I need to do is search through the query results and count up how many of each product were produced (02 AA, 01 AB, etc...) and the totals for each category. The number of categories is pretty limited (6), but there are hundreds of product codes, so I need a way to do this without having to type in each induvidual product code as the requirement by which the query searches. Also, the product codes that get returned are different every day.

I was thinking something along the lines of take the product code of the first row and check for any others in the results that match and write that into another table. Then move onto row 2 and use its product code as a search parameter and search through the query results for any matches. Then continue that until the end of the query results. Can I do that? Is there a better way to achieve what I need?

View 7 Replies View Related

Combobox Within A Query

Nov 24, 2005

I'm not entirely sure if this is possible, however I'm pretty sure I have seen it done in the past. But I've been racking my brains and scouring google for the solution with no luck what-so-ever.

What I'm trying to do is display a query, where one of the fields will have a drop down box that you can select from multiple values. I dont want to give away much information about the database structure (sensitive data, and all that fun stuff I'm sure most of you are familiar with). So I'm going to make up a hypothetical situation here.

Table: Person
Fields: pID, pFName, pLName, sID

Table: Status
Fields: sID, sDescription

Here is the basic query:

Select pID, pFName, pLName, sDescription
FROM Person, Status
WHERE Person.sID = Status.sID;

Then when the query is displayed, I'd like the status description to be capable of dropping down a list of the other possible selections. Now I know this wont work on a standard query. So what I did was create the query, then a form that displays in a query view. I have the one field as a combo box instead of a text box. However I'm just having trouble linking it up, it just shows what the current value is but not the other possible options.

If anyone could point me in the right direction, I would surely appreciate it.

Thanks

View 1 Replies View Related

Using ComboBox Value In Query

Feb 6, 2007

I have a form with a combobox called fraShipDay. How do I reference the value of the user's selection in a query? I've tried using Forms![Form1]![fraShipDay] but it's not working.

View 2 Replies View Related

Query By Combobox

Jul 27, 2007

Hi people.

I am creating a database for my dad's business. I am nearly finished but there is one more function that he needs from it and I have scoured the forums here and the web to try to find an answer to no avail.

Basically I want to design a query which returns a total VAT amount for jobs invoiced by quarter of a year. Looking at the forums etc I have found a way to query using the combobox where the values in the combobox are the table values, and I found a way of the query prompting for the start-finish dates, but the combobox that I want to use won't relate to any existing field headings (if that makes sense) ie option1 would be q1 (ie Jan, Feb & March) option2 would be q2 (April, May & June) etc. In my Invoices table, the VAT figure is already worked out for each invoice and is stored in a seperate field, so I don't need the query to work out the figure, but I just need help to set up the query/combobox so that it filters by 3 month's worth of dates as selected in the combobox.

Any help would be much appreciated. I got it to work whereby the query prompts for dates, but remembering the start/finish dates of the quarter seems a bit daft when these could be selected from the combobox.

PS I am quite new to this programming malarky so start from the beginning with any help :D

Thanks in advance

Nik

View 1 Replies View Related

Combobox SQL Query

Dec 14, 2005

Hello everybody,

I am new to this forum. Currently, I am designing a database for the company I work at. It is the first time I use ACCESS and it is ACCESS 97 (!).

Now my first ( of probably many following ) questions :

I have a table with a key data field. Now I want to set up a combobox which lists all entries of a data field in that table ( but it's not the key field ). But, I do not want duplicate entries.

The SQL query for the combobox as created by the wizard looks like this :

SELECT DISTINCTROW NEW_ID.[Project ID], NEW_ID.[Work ID]
FROM NEW_ID;

I only want to display the "Work ID" entries, without duplicates. "Project ID" is the key. I already tried to change DISTINCTROW into DISTINCT but that does not work because every entry in "Project ID" is unique, only the "Work ID" entries can repeat.

If I omit "NEW_ID.[Project ID]" in the query, nothing is displayed...


So, what should I do?! Please help, many thanks in advance!!

Victor

View 5 Replies View Related

Value Of Combobox Into Query

Jan 6, 2013

I am new to access and was going through some tutorials. I am not able to run a query that takes value from a combobox and display the results based on that.

I used [Forms]![CustomerF]![StateCombo] under the criteria but its not generating the results..

I have also attached the db i am using ....

View 1 Replies View Related

How Can I Filter One Combobox Based On Another Combobox Selection?

Apr 22, 2005

I have 2 comboboxes, the first one is called "activity", whereby I have 3 options to choose from, and the second is called "level".

When I click an "activity", for example Drawings, I want the "level" combobox to list a unique set of options for that category. and if I click on a different "activity" for example Planning, I want the "level" combobox to show a completely different set of options.

If anyone can give me any help on how to do this then I would be very grateful!!

Thanks

Angela :eek:

View 2 Replies View Related

Return Weekend Results On Monday, Yesterday's Results Otherwise

Nov 14, 2007

I am trying to filter a form to show the entire weekend's activity on Monday but only yesterday's activity Tuesday through Friday. Using this code I can return Friday's results on Monday and yesterday's for the rest. How do I get the range Friday to Sunday?

IIf(DatePart("w",Now())=2,Date()-3,Date()-1)

Using >Date()-3 doesn't work.

Thanks

Bruce

View 5 Replies View Related

Query Results In Form, But What If Query Is Null?

Aug 30, 2005

I have a query that displays results in a form, but if the query is null, I want to display a different form, or just an error message that says something like "your query returned no results" (right now it will display the form with no fields)

I am a beginning Access/VBA user and have searched and browsed the forum for combinations of null/query/form, but haven't found what I need. Can anyone point me in the right direction?

Thanks for any help.

View 5 Replies View Related

Append Query / Combobox

Sep 19, 2007

Hi all,

I am hoping this is a simple dumb mistake I am making. I set up a two tables and an append query. The two tables are: first a table of employees and second a table of terms. I am using the last column in the table of employees to send a list to the terms table with an append query.

With that everything works fine. I even created a form of the table of employees so it could be edited on the form instead of the table. It still worked fine. The problem came in when I change the text box on the form that governed the term field to a combobox. I used "With me.combo...." in VBA to add a yes or no selection to the combo box.

When I try to run the append query then I am told their are lock violations and validation rule violations.

Any thoughts?

View 1 Replies View Related

Use Combobox From Form In Query

Mar 11, 2008

Hello,

I have a form containing a combobox with the values yes (1) and no (2).

In my query I have a date field. When the value of the combo is yes only the dates should be displayed. is the value no the the empty fields should be shown. I nothing is selected all fields should be displayed.

I tried this:


IIf(IsNull([Forms]![Form1]![cboDate]);
IIf([Forms]![Form1]![cboDate]=1;[tblITEM]![date_ID] is not null; is null);[tblITEM]![date_ID])

But without success.

View 1 Replies View Related

Query Results

Nov 30, 2005

I am wanting my query results to appear in my main form so that i can edit them, rather than a table the query is just a look up of my form that stores about 500 records and stores all the same fields

any help would be appreciated

thanks

View 1 Replies View Related

One Query W/many Different Results

May 21, 2007

Is there a way to write one query that will work for different criteria and is run by different buttons to produce bar graphs or a basic report depending on the button the user clicks??

View 5 Replies View Related

Query Results?

Jul 22, 2007

Hi all :o

I am working on a query but can manage to get it to do what I want.
I have a main table with a job_ID and a faults table which documents faults that occur related to that Job_ID the tables are related with a one to many relationship. I want the query to bring up all the jobs even those with no faults, at present it is only bring up those jobs that have faults, how do I include details of all the jobs and if there are no faults then that field is left blank, probably very simple to do but after working on this db for hours my brain is no longer functioning!! :eek:

Thanks

Jackie

View 2 Replies View Related

Help With Query Results

Jan 4, 2008

Hello all,

I have a table called tblODF and within that table, I have these fields:
- ODFNumber
- ODFScanDate
- Status (Combo box: Pending, Complete, Licensing)
- LastFollowup

In my query, I have the same fields, except I added a calculated field.
I added DayCount to

Codecalculate:(Date()-[ODFScanDate]

This should calculate the number we've had the ODF.

What I want to happen is, let's say the status is Maturity, I want the DayCount to say 0. If it's pending, I want it to calculate the actual days.

Is this possible?

Thanks

View 5 Replies View Related

Query Results

Nov 19, 2007

I've just started using Access 2007, but I've been an Access 2003 user for some years and have a couple of databases, both of which I've now brought over to 2007.

Something I've noticed and is probably very simple. In 2007, after I entered information in a table via one of my forms, I queried on that information but it wasn't included in the results. But everything else - from 2003 - was. I then went thru each field in the underlying table to "match" fields there were filled in for a 2003 record and now the new entry does appear in the query results.

This hadn't happened before in 2003 - it didn't matter if all or even particular fields were filled in. But now it needs for at least some particular fields to be filled in. Don't know if it's something different in 2007, or probably coincidental. I haven't changed anything in the table, query or entry form.

It's not a crisis (now that I see my results), but I'm wondering what is going on - now, that apparently wasn't occurring before?

Thanks!

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved