Auto-populate comboBox with value from Row Source

I am a novice to intermediate Access 2003 user with some VBA experience.

I have a form with 3 combo boxes.  All three combo boxes have queries which
return a single column, as their row source.
Upon an update to the first combo box- the row source for the second Combo
Box is requeried based on the value from combo box 1. 
Is it possible to have the (2nd) combo box display (auto-populate) the first
value of the resulting (re)query?

The drop-downs function correctly based on the queries.  I am trying to avoid
the user needing to use the drop-down when only one value is returned from
the query.

I think I have a solution using recordsets- but have a hunch there is an
easier (probably built-in) solution.

Thank you for your time.

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201002/1

0
rsamoose
2/24/2010 8:44:22 PM
access.formscoding 7493 articles. 0 followers. Follow

2 Replies
3300 Views

Similar Articles

[PageSpeed] 26

After you set the rowsource for Combo2, use the following:

Me.Combo2.value = Me.Combo2.ItemData(0)

This will post up to the first item in Combo2

"rsamoose via AccessMonster.com" wrote:

> I am a novice to intermediate Access 2003 user with some VBA experience.
> 
> I have a form with 3 combo boxes.  All three combo boxes have queries which
> return a single column, as their row source.
> Upon an update to the first combo box- the row source for the second Combo
> Box is requeried based on the value from combo box 1. 
> Is it possible to have the (2nd) combo box display (auto-populate) the first
> value of the resulting (re)query?
> 
> The drop-downs function correctly based on the queries.  I am trying to avoid
> the user needing to use the drop-down when only one value is returned from
> the query.
> 
> I think I have a solution using recordsets- but have a hunch there is an
> easier (probably built-in) solution.
> 
> Thank you for your time.
> 
> -- 
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201002/1
> 
> .
> 
0
Utf
2/24/2010 11:11:01 PM
That is exactly the functionality I wanted.

Thank You.
Ryan

DrGUI wrote:
>After you set the rowsource for Combo2, use the following:
>
>Me.Combo2.value = Me.Combo2.ItemData(0)
>
>This will post up to the first item in Combo2
>
>> I am a novice to intermediate Access 2003 user with some VBA experience.
>> 
>[quoted text clipped - 13 lines]
>> 
>> Thank you for your time.

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201002/1

0
rsamoose
2/25/2010 1:01:51 PM
Reply:

Similar Artilces:

Populate a cell if values in cell 1 and cell 2 match cell 3 and 4
I need help with a formula please. I need to search through a column of data and populate a cell if it meets a condition. For example: IF FirstWorksheet!A2 = SecondWorksheet!ColumnAx and FirstWorksheet!B2 = SecondWorksheet!ColumnBx Then populate SecondWorksheet!Cx with value from FirstWorksheet!C2 I have to match up a column of data in one worksheet with data in 2 columns in another worksheet. Help plz. Thanks T- A multi-criteria index n match (array-entered) should work here In Sheet2, Copy n paste this into C2's formula bar, then array-enter the formula by pressing CTRL+...

Auto Filter problem
I am using the auto filter for a particular column to sort out differen medical programs. When I click the drop down and click a program, i doesnt show me ALL the lines that say this particular program. Why is this? -- Message posted from http://www.ExcelForum.com Hi maybe some hidden characters in these lines 8e.g. additional space characters, etc.) -- Regards Frank Kabel Frankfurt, Germany "jkb724 >" <<jkb724.19rasx@excelforum-nospam.com> schrieb im Newsbeitrag news:jkb724.19rasx@excelforum-nospam.com... > I am using the auto filter for a particular column to so...

Difference between two date/time values
Hi, Cell A1 has 21-04-10 07:00 PM Cell A2 has 06-06-10 07:52 AM (the dates are in the dd-mm-yy format) Cell A3 has the formula =A2-A1 for showing the differences in days and time and is formatted with the custom format: dd h:mm:ss The display in cell A3 is 14 12:52:00. While the difference in hours is okay, the difference in days should be more than 14 as there is are 31 days of May between the two dates. Is there another format to show the correct difference in days or should be done some other way? Please help. Thanks in advance. Regards, Raj Do you really need ...

Auto-Editing
Word 2003 has a very annoying default. It assumes too much! If I reformat a few words in a document, it changes the entire document to that formatting. Grr-rrr-r! I have to constantly press undo to get what I want. I know there's a feature that's causing this annoyance but I can't find it to turn it off! Can anyone help, please? See http://word.mvps.org/faqs/formatting/wholedocumentreformatted.htm. -- Stefan Blom Microsoft Word MVP "Connie Martin" <ConnieMartin@discussions.microsoft.com> wrote in message news:CD959D82-F81B-4A9D-993E-73...

showing data values on chart
in excel when mouse stand on chart,excel is showing the data values of that point.how can to do this action in access? Exactly the same. When you hover the mouse over a data point for a little amount of time, a yellow bow should come up describing what's in your data point. -- Regards, Steve "afshin" wrote: > in excel when mouse stand on chart,excel is showing the data values of that > point.how can to do this action in access? Where you insert chart?i insert chart on report,and i can't to see data value on data point. "Steve"...

Create a button to insert a new row.
I know Excel can do it; I just don't know how. In addition, once the new row is inserted, I need the formulas to carry into it. Any help is greatly appreciated! I can think of many possibilities, but I'm sure you are thinking of something very specific. Please give more information. -- Ryan--- If this information was helpful, please indicate this by clicking ''Yes''. "Sharon" wrote: > I know Excel can do it; I just don't know how. In addition, once the new row > is inserted, I need the formulas to carry into it. > &g...

Auto-Calculate
I have a spreadsheet that utilize the stock quote add-in from MSN. On a daily basis I refresh the add-in functions for the Highs, Lows, Last, Volume, etc. On occasion the spreadsheet reverts to manual caculation settings, and I have to press the F9 even after I updated the quotes. I've always preferred the any spreadsheets I open, blank or otherwise, the automatic setting selected for calculations. I consider this an annoyance. Has anyone experienced this glitch? Is there a fix for it? Ron_D Ron Excel takes the calculation mode from the first workbook that opens in a session. Sub...

auto copy self
How do I arrange for Outlook to automatically copy myself on every new, reply or forward email? If you mean keep a copy of all sent, see settings under Tools/Options/Email Options and Advanced Options David "rich" <steamuk@aol.com> wrote in message news:055c01c3664f$dadecd30$a001280a@phx.gbl... > How do I arrange for Outlook to automatically copy myself > on every new, reply or forward email? ...

Set minimum values for equation results
Hi all, I've been searching the queries here and can't find an answer to what I'm hoping is a simple query . . . I want my equation to ensure that any minus values are returned as 0 but positive values should remain true. THis needs to be within the original equation as opposed to a separate equation doing a find and replace. Appreciate any answers (preferably by e-mail!). Jim. Try using IF(), for example: Put in C1: =IF((A1-B1)<0,0,A1-B1) which will return 0 if (A1-B1) results in a minus value with zero & positive values remaining true Hope the above helps. M...

Auto correct or Auto complete
We are all familiar witht he auto correct or auto complete functions found in MS applications. Of course that means it is available in Access also. My question is this ... can this function be replicated within the DB, so that the set of auto correct items are part of the package rather than something that would have to be set up on each individual desktop system? It's use, for me, would primarily be within a memo field where medical abreviations, used as a shortcut, would convert to the true meaning as the user types them in. Ex: "prn" without quotes would change to. &qu...

Auto Scale Chart Macro -- Any improvements please?
This is the best way I've found to correctly scale a chart -- the only way I found to exclude a chart interpolating with #NA cells was to delete those cells containing #NA, and run the chart. This takes a long time on my computer. Wondering if there is a better way. This macro is directly taken from 2 excel mvps and modified; i believe a mehta and ron bovarty, but could be wrong. Thanks for taking a look. Sub AutoScaleYAxes() Dim ValuesArray(), SeriesValues As Variant Dim Ctr As Integer, TotCtr As Integer Application.Run "Extend_Stock_Data" Applic...

How to generate a string with values from a range?
I ahve a little macro that is passed a range. It does some work on the individual values. I have written a subroutine that writes debug data to a side file. I would like to dump the values in the input range to the side file as a delimited string. If it was an array variable, I could use the Join function. I have tried various combinations, but nothing works. Can someone show me a single line of code that will generate a single string from a range variable? I know I can do it with a loop, but I'd prefer a single statement (perhaps using Join) is possible. Single line of exis...

OWA auto login
I am trying to use the credentials from the forms authentication login to automaticaly log in to Outlook Web. I redirect to a URL with this format: http://UserName:Password@mailserver/exchange I have seen this example in other posts but this does not work for me. I still get the Outlook Windows Login prompt. Perry Perecli Manole wrote: > I am trying to use the credentials from the forms authentication > login to automaticaly log in to Outlook Web. I redirect to a URL with > this format: http://UserName:Password@mailserver/exchange > I have seen this example in other posts but t...

Problems with Inserting Rows
Morning Everyone In my previous version of Excel I could click on a row and then "Insert copied cells" anywhere on the sheet (as a new row). My problem is that with this version (2003 professional), when I try and re-insert the row, all the formulas have been converted to values. How do I switch back to inserting the row with formulas Many thanks in advanc Ja Inserting a row seems to work the same in Excel 2003 as in earlier versions, but maybe if you lay out the _precise_ steps to duplicate the problem someone can help you. In particular "re-insert the row" is unc...

Auto look through subfolders
Please help. I can write a macro that will extract data from all excel files in a specific folder. What I need to be able to do is write a macro that will automatically extract data from excel files within folders and sub folders and sub sub folders etc For example the data is all held on the following directory: H:\development forms\2006 cost sheets\ And within that directory by customer - for example Tesco, Boots, Asda etc. These customers are then subdivided into product ranges - eg 1,2,3,4 etc and some futher subdivided by national or exclusive. All the excel files are in exactly th...

Count number of lines of text in a range/value.
To start, 1) Add a form w/ a textbox to your VBA project. 2) Set the textbox's AUTOSIZE property to False. 3) Set the textbox's MULTILINE property to False. In your code... 4) Call on the Form's SHOW method (modal or modeless is irrelevant). 5) Set the textbox's TEXT property to the (trimmed) value you are working with. 6) Set the textbox's AUTOSIZE property to True. 7) Set the textbox's MULTILINE property to True. 8) Save/get the textbox's LINECOUNT property. 9) Call on the form's HIDE method. btw, I assume no responsibility for the code. Use it at your own...

macro help = extract content of specific columns accross a row
have a spreadsheet which consists of about 5125 rows and 2840 columns. I am using Excel 2007 in order to get access to the extra columns. Now I need help creating a macro to automate a very tedius and manual task. The first column in the spreadsheet is empty. What I Need =========== For every row I would like to extract the contents of certain columns accross the row and copy to the first column of the row. into the first column i would like to copy the contents of the following columns accross the row. 6C = sixth column, 9C = 9th column etc... 6C + " " + 7C + " &...

Any way to get rid of an auto-suggestion in the login dialog box, for Exchange/OL using RPC over HTTP?
A client was using RPC over HTTP to two different Exchange servers (OL prompting for profile on startup). Both profiles were set up to prompt for credentials upon connection to Exchange. There's now only one Outlook profile needed; the other is gone and OL isn't prompting for the profile selection any longer, which is fine. However, Outlook is remembering domain1\user and domain2\user in the login dialog box, and I'd love to be able to get rid of the no-longer-valid credential dropdown suggestion. (The computer is not a member of a domain and hence always needs to be prom...

value of y axis position
Hi, all, After reversal of x axis, I moved y axis from right to left. However, value of the y axis appears inside of the chart, how can I move them outside. Many thanks. Billy Your statement is a little vague. If in Format - Axis, I use "Values in reverse order," it moves the Y axis to the right side, but the Y labels appear outside the chart, not inside. Or I can use "Value (Y) axis crosses at maximum value, " which also moves the Y axis to the right side, but the axis labels are still on the outside. Try this. With the Y axis selected (click any y axis label)...

Auto date
I am trying to create a field in a form that if anything is changed on it, it will automatically update the date to current date. Is this possible? Sojaminc wrote: >I am trying to create a field in a form that if anything is changed on it, it >will automatically update the date to current date. Is this possible? Make sure the last changed date/time field is in the form's record source table/query. Then use the form's BeforeUpdate event: Me.lastchanged = Now -- Marsh MVP [MS Access] Hi - You can do this in the On Dirty event of the form, which fires as soon as you m...

An auto reply to an auto reply!
Had the funniest situation yesterday. Somebody emailed a public folder we have set up. On there we have a rule to send a reply saying thanks for your email -someone will be with you shortly (we have to have this message on - it is for some website that recently went live). Now that auto reply went back to the guy who emailed - who must have sent it from a public folder himself (as he forwarded the original email from a public folder). The guy received our auto reply - and promptly his email system sent an auto reply to us. As is the way it is set up - our email system sent him an auto ...

Data validation with a cell value linked to the same cell.
I Think that my post name is very confusing but I'll explain. I�m doing a data validation in cell f1 usig the data validation option the value entered in cell f1 need to be equal or greatter than th value in cell b2 and cell b2 is calculated with the formula =a2+c4-f1. What I'm trying to do is to prevent to enter a value in cell f1 tha I'll make cell b2 negative. But its not working, any suggetsions??? Thanks. Rodolf -- Message posted from http://www.ExcelForum.com Change your CF criterion to Formula is = F1 <= (A2+C4) In article <rodolform.161w07@excelforum-n...

counting values in a column
I have different values in a a column that I need to count. Column A: 2,25,45,52,25,30,2,45,80,60 and I want to count values as follows <30 = 4 >30 and <60 = 4 >60 = 2 I have tried countif and sumproduct but it doesn't work correctly. Your assistance is greatly appreciated. Set up a table in column B1:B4 like this: 0 29 59 999 where 999 represents a number which is surely higher than the highest value in column A, select range C1:C4 and enter this formula: =FREQUENCY($A$2:$A$11,$B$1:$B$4) and confirm it with Ctrl+Shift+Enter (it's an array formul...

Auto-Alphabetize
I have a master data sheet, with columns of different information. I'd like to pull information from 3 different columns (Rank,LastName,Shift) into a separate column (I know how to do this). What I would then like to have happen is, in another separate column, have the information sorted alphabetically by last name. There are duplicate last names, in which case I'd like them sorted in rank order. Is this at all possible? Also, I can't use a VB Macro - it needs to be in a formula or array format. Rank.......LastName.........Shift PO Smith B/1 ...

How do I auto-reply incoming eMails ?
During my holidays I want to inform the sender of incoming eMails that I am currently not in office. How can I setup an auto-reply note? Do I setup this in my Outlook 2003 or in the Exchange Server? Joe If you connect to an Exchange server at work, use the Out of Office function (under tools). It will reply once to each sender that you are out of the office. By default in Exchange, auto-replies to the internet are turned off so only internal addresses would receive the Out of Office reply but verify with your Exchange Admin how they have the server configured. If you have a POP3 acc...