Use query for Row Source?

I attempted to use a combo-box to look-up records on a form.  The RowSource 
query that is generated by the wizard included 2 data fields. I wanted to 
show only a distinct list of the second, non-key data element (col1).  When I 
changed the RowSource query to SELECT distinct Col1, the combo-box displays 
nothing.  I then created a stored query with the SELECT distinct Col1.  They 
query runs correctly, but when I put in in the RowSource, it displays nothing.

Any clue what I could be doing wrong?  
0
Utf
10/26/2007 7:17:03 PM
access.forms 6864 articles. 2 followers. Follow

2 Replies
2411 Views

Similar Articles

[PageSpeed] 31

On Fri, 26 Oct 2007 12:17:03 -0700, JHC wrote:

> I attempted to use a combo-box to look-up records on a form.  The RowSource 
> query that is generated by the wizard included 2 data fields. I wanted to 
> show only a distinct list of the second, non-key data element (col1).  When I 
> changed the RowSource query to SELECT distinct Col1, the combo-box displays 
> nothing.  I then created a stored query with the SELECT distinct Col1.  They 
> query runs correctly, but when I put in in the RowSource, it displays nothing.
> 
> Any clue what I could be doing wrong?

Using the same Combo box properties as generated by the wizard?
You've gone from 2 columns to one. 
Change the column widths from something like 0",1" to 1"
Also change the column count from 2 to 1.
Make sure the Bound column is 1.
-- 
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
1
fredg
10/26/2007 7:39:47 PM
Interesting.  Why VBA choose to get 2 columns when I select one will remain a 
mystory.  Thanks for the tips on how to make it work.  I very much appreciate 
it.
-JHC

"fredg" wrote:

> On Fri, 26 Oct 2007 12:17:03 -0700, JHC wrote:
> 
> > I attempted to use a combo-box to look-up records on a form.  The RowSource 
> > query that is generated by the wizard included 2 data fields. I wanted to 
> > show only a distinct list of the second, non-key data element (col1).  When I 
> > changed the RowSource query to SELECT distinct Col1, the combo-box displays 
> > nothing.  I then created a stored query with the SELECT distinct Col1.  They 
> > query runs correctly, but when I put in in the RowSource, it displays nothing.
> > 
> > Any clue what I could be doing wrong?
> 
> Using the same Combo box properties as generated by the wizard?
> You've gone from 2 columns to one. 
> Change the column widths from something like 0",1" to 1"
> Also change the column count from 2 to 1.
> Make sure the Bound column is 1.
> -- 
> Fred
> Please respond only to this newsgroup.
> I do not reply to personal e-mail
> 
0
Utf
10/26/2007 8:31:01 PM
Reply:

Similar Artilces:

errors with form or query acrivated
Just converted from Access 97 to Access 2002. Here's the problem: User defined expressions (may be only text expressions) or fields show errors when a form or query window is activated or deactivated. The query will not refresh. For example, we are having trouble with the SSN in the Grants database. We haven't seen the same problem in other applications, but we haven't specifically looked for it. To be more specific: The Object Form_ParticipantsToProgramCycle has a listbox which contains a last name and a user defined expression that formats the Participants SSN i.e. 1...

how do i calculate 10% of a total in an access query
I am working in access 2007 and have a goal amount that i need to calculate a 10% increase.. I cant figure out how to do this!! Increased Price: ([YourField] * .1) + [YourField] -- KARL DEWEY Build a little - Test a little "confussed student" wrote: > I am working in access 2007 and have a goal amount that i need to calculate a > 10% increase.. I cant figure out how to do this!! On Mon, 25 Feb 2008 09:13:10 -0800, confussed student wrote: > I am working in access 2007 and have a goal amount that i need to calculate a > 10% increase.. I cant figure out how to do...

Strike-through an entire row.
OK... I need to know if there is a way I can strike through the text on a row by highlighting the row with the defunkt information and activating a macro. Let's see if I can give an example. Say I'm entering data in, row by row... Each row's data is SIMILAR but not the same. Now let's say that apon review I notice that one of the row is incorrect. I need to be able to highlight the row (Presumably by selecting the corresponding number on the left hand side {1,2,3 etc}) then I need to run a macro (that will eventually be tied to a button) and then be done the macro would tur...

Using MS Access information in Outlook
I have an MS Access DBase that contains our companies contact information. I want to be able to use that information in an Outlook contact folder. I do not want to import the information into Outlook. I want it to be automatically synchronized. Is this possible? Mikeal ...

How to generate XML file as follow, using XmlDocument
Hello, I have to generate XML file as follow, using XmlDocument. <Company> < Employee EID=3D=94111=94 Description=3D=94 xyz=94> <Dept DeptNo=3D=94D10=94> <FirstName> Abhijit </FirstName> <LastName> Babar </LastName> </Dept> <Dept DeptNo=3D=94D20=94> <FirstName> Sahine </FirstName> <LastName> Ghavane </LastName> </Dept> </Employee> < Employee EID=3D=94222=94 Description=3D=94 abc=94> <Dept DeptNo=3D=94D10=94> <FirstName> Swapnil </FirstName> ...

Excel VBA
Hi again, I have enclosed a timesheet which i want to break down the day activities by a percentage, so if my sheet says an activity took a hour then the day column would tell you percentage of a seven hou day. Also i want the date column date to change each day. Currently it work for one day but then the next day it changes all the above cells to th current date. I have attached the file Cheers Stev Attachment filename: book2.xls Download attachment: http://www.excelforum.com/attachment.php?postid=56396 -- Message posted from http://www.ExcelForum.com ...

Change background color of query results from access in worksheet
Hi, I have Excel 2007 and selected Date => From Access and then navigated to an Access DB and selected a query. I chose "Table" view. The query results now appear in my worksheet which is great. However, I want to change the background. Right now it alternatives by row between a light blue and a darker blue. I want the results to have a white background with black borders but have been unable to change the format. If I go to Home and select No fill for a color background nothing happens. Is there a way to change the query results? Thanks, Could be the r...

Sorting rows out of order after all rows are numbered in sequence
Data is in 4 columns with Headers described below: Col A - Line# (rows are numbered in original order in worksheet) Col B - Acct# (property number) Col C - Category (code for the type of information in the rows ie: E, V, X, T) Col D - Label (description of the data or values in the row) There is one row of Expenses (all begin with "LOE - ") that is numbered out of sequence from the other "LOE -" items. I need to Move it up with the other "LOE -" items and if possible Re-sort all the "LOE -" items BUT only the "LOE -" rows within e...

PatchFactory 2.0 Released. Professional and easy-to-use patch building tool for Win9x/Me/NT/2000/XP.
Description: Professional and easy-to-use patch building environment that can help you to create instant patch packages for software and file updating. Generated patch packages are small size self-extracting executable update programs in a famous installer style with adjustable user-friendly interface and multilingual support. Enhanced with features like easy-to-use interface including a Wizard mode, powerful patch engine, integrated compression technology, adjustable multilingual user-friendly interface of the update program, this program will most definitely become a valuable asset for softw...

Search and Replace, or Add New Row
I am using Excel 2003. Worksheet1 contains columns (A) Invoice (B) Name (C) Address (D) P.O.# ... and others. I need to perform a search of column A using an invoice number and if it IS FOUND, then replace the entire row with new data. If the invoice number IS NOT FOUND, then I need to add a new row. Is there a simple way to do this? Check your other post.. "GEdwards" wrote: > I am using Excel 2003. > > Worksheet1 contains columns > (A) Invoice > (B) Name > (C) Address > (D) P.O.# ... and others. > > I need to...

Why doesn't indirect work with a dynamic range created using offse
Hi Has anyone else experienced this issue or I am doing something wrong. I have a series of dynamic range names defined using offset. For example the name USCities is defined as =offset(AA1,0,0,Counta(AA:AA),1) and the name Europeancities is defined as =offset(AB1,0,0,counta(AB:AB),1) In column A, dataentry into the cells is limited to USCities or Europeancities. In column B, I want to limit data entry to the range name appearing in column A. For example if USCities is selected in A1, data entry in cell B1 is to be limited to those cells forming the USCities range name. I have tri...

Create Outlook 2003 Rule using 'Or' operator in 'Sent to' condition
How do I create a rule that uses the 'or' operator in the 'sent to' condition? I actually have a rule like this, but don't know how I created it. In other rules, when I try to add more that one email address or group in 'sent to,' Outlook inserts the 'and' operator. What is the exact rule in full? In general you'd create additional rules but it depends a bit on the condition or action that you are using. -- Robert Sparnaaij [MVP-Outlook] Coauthor, Configuring Microsoft Outlook 2003 http://www.howto-outlook.com/ Outlook FAQ, HowTo, Downloads, Add-Ins ...

parent/child row relationships
I have a database that contains several rows for one record. (I didn't set this up) Anyway, there is a header row that has one or more detailed row, using the same ID number. There are unique keys that are in sequential order for each row. I need to be able to bring up the header row on the top of the form, and all detail at the bottom of the form -- VB@work You gonna need form and subform with Master/Child link on the Record field (ID number). Use these queries -- Van_Work_Header --- SELECT Van_Work.Record, Van_Work.Sequential, Van_Work.Text1, Van_Work.Text2 FROM Van_Work ...

Pivot tables, linking to a named range as a source to a pivot table
I have created a main worksheet within the same workbook of many pivot tables, and I want to use this same worksheet as the source of information to these different pivot table sheets off of which I create charts. I want to use a named range because there are over 4,000 rows in this main worksheet. I am not sure if I need a "=" to start the reference or what to do. I thought I should just use nameofworksheet!database if I name the range "database", but when I point and click to the sheet, it is just inserting the name "database" without the name of the...

Query
How could I force the query results to output to a specific format/template? The reason for this is that certain values don't exist in certain date ranges within the data pool. I need those values to be included in the query results anyway. I have tried linking another query(tried a table also) with the template to the query that calculated the results. Is there something I should consider when doing this? A better way? Thank you Erik Create a new query that includes the table that contains the domain of values you want to appear in the output and join that table to the existin...

Permission to use object denied.
I have a user on a Windows 2000 machine with user rights. The user is also running office 97. When he opens a excel speedsheet and Enable's Macros, he gets the following message; "Permission to use object denied". Hi Shannon............ It sounds like there is some sort of link to another workbook that a macro is calling and your user does not have rights to it. I think I would open the book without enabling the macros, and then take a look at them to see if one is trying to do such a thing. hth Vaya con Dios, Chuck, CABGx3 "Shannon" <Shannon507@aol.com>...

How can I retrieve rows from 11 to 20 ( Selete TOP 10 gives first 10)
Using 'Select Top 10' gives me first 10 rows of my table. I need to retrieve the next 10 records. I am writing to an excel spreadsheet where I need to write top 10 rows starting from B2 and next 10 records starting from I2. So how can I split them? Every time I have to split into 10rows each. Thanks -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/201004/1 Something like this will get the job done. I don't know your table/ field names... SELECT TOP 10 primaryKey FROM myTable WHERE primaryKey NOT IN (SELECT TOP...

Insert Trigger to Update Value of Column in Inserted Row
I am trying to write a SQL Insert trigger which would populate the value of a column in the inserted row with the value of a column from another database table. The table into which the row is inserted does not have a primary key match with the other database table. The two tables can be related through a join to a third table. "CarlC" <CarlC@discussions.microsoft.com> wrote in message news:834D03E6-84CA-4CF3-9781-12FA18713940@microsoft.com... >I am trying to write a SQL Insert trigger which would populate the value of >a > column in the inserted ...

row height #12
My default row height is set at 13.20 and it goes up and down in .6 increments. Everyone else in my office has the default as 12.75 and it goes up and down in .75 increments. Our fonts are exactly the same, and every other option we could think of is the same, where can I adjust this? Thanks Open a new workbook and make the desired change to row height, save the workbook in C:\Program Files\Microsoft Office\Office10\XLStart as Book.xlt (or wherever located on your system). Make sure you move and save the original Book.xlt first in case you decide to restore the original. I don't ...

Accessing a linked file in a Word document using VBA
Hi - Basic question, in my Word template I have some linked images. I want to use VBA to change the path and filename of some of these links ... can anyone give me a clue as to how I should best do this? Thanks Robin Hi Robin, To see how to paths in Word using vba, check out the macro solution I've posted for implement relative paths at: http://lounge.windowssecrets.com/index.php?showtopic=670027 -- Cheers macropod [Microsoft MVP - Word] "Robin" <Robin@discussions.microsoft.com> wrote in message news:7EA2C548-7D01-4515-BCC8-2EF3210439C9@microsof...

Data validation causing problems when using a data form in Excel 2
I have an Excel 2007 workbook that includes data validation set on a number of cells. When using a data form to enter data and I enter an invalid value on the form field corresponding to one of those cells I receive the validation error dialogue that prompts me to retry. I enter the correct data into that field on the form then close the form. My worksheet only has the data relating to the corrected field entered. All other data entered via the form is not entered onto the worksheet. Is this a bug in Excel 2007? I previously was using Excel 2002 and found that when using a ...

Using Outlook on a MAC
Does anyone know why I can't forward HTML email with Outlook on my MAC? It is received ok but when I forward it, it goes out as text and all the formatting and images are gone. I'd appreciate the help. ...

Using Exmerge in batch-mode doesn't work
Hi there, I want to "backup" the mailboxes from my Exchangeserver to pst-files with Exmerge. I seem to have the same problem though as more people seem to have with the Exmerge utility but I haven't seen any solutions yet :-(. If I walk through the Exmerge steps using the GUI everything seems to go allright. I get a list of mailboxes, I pick the ones I want to export to .pst en Exmerge does it's thing creating a bunch of perfectly healthy .pst's. When I want to use it in batch-mode using MAILBOXES.TXT containing the mailboxes I want to export, Exmerge logs it can...

Append Query
Ok now Im confused, I changed the starting No of my autonumber the other week, worked fine. I have now added a few more bits to my db and want to do it again to clear it all ready for use and its not doing it, maybe me?? I am trying to make it start on 4183, so far all I have amaged for it to do is create a record with 4182 but then the next autonumber goes to 4203 which is what I was up to when testing, before the next job would just be 4184. Ok so this is what im doing, maybe someone can see If i missed anything out. I deleted all the records in my table I created a table with one number f...

SUm function and adding rows
Is there a way to get the SUM function to increase the range if a row is added right above the previous SUM range. FOr example to go from SUM(C3, C22) to SUM (C3, C23) when I insert a row directly above row 24 - wher the SUM function resides. You could use a formula like this in C23: =SUM(C2:OFFSET(C23,-1,0)) FredZack wrote: > > Is there a way to get the SUM function to increase the range if a row is > added right above the previous SUM range. FOr example to go from SUM(C3, C22) > to SUM (C3, C23) when I insert a row directly above row 24 - wher the SUM >...