Setting list box row source in VB

Hello,I am trying to set the row source to a query in VB so it can bedynamic depending on which option is chosen the previous form. Theuser is on a form, enters data, chooses Ok, and I want the form withthe listbox to pop up, which it does. My problem is setting the rowsource in VB. If I set the Row Source to "test1" in properties itworks fine. I've tried several ways of doing this in VB. Ideally Iwould prefer it on the previous form for an onclick event. I've triedputting the horse in front and behind the cart as so:db1.Form_searchlist.lstSearch = "test1"DoCmd.OpenForm "searchlist"And also:DoCmd.OpenForm "searchlist"Forms!searchlist!lstSearch = "test1"I even tried making it an onload event on the searchlist form, butnone of these work. I'm providing the same criteria in every way forthe query, so I should have results on the list box.Is there a way to do this that actually works?
0
requeth
3/9/2007 6:43:08 PM
access 16762 articles. 2 followers. Follow

3 Replies
1040 Views

Similar Articles

[PageSpeed] 34

In news:1173465788.777648.113520@v33g2000cwv.googlegroups.com,requeth@gmail.com <requeth@gmail.com> wrote:> Hello,>> I am trying to set the row source to a query in VB so it can be> dynamic depending on which option is chosen the previous form. The> user is on a form, enters data, chooses Ok, and I want the form with> the listbox to pop up, which it does. My problem is setting the row> source in VB. If I set the Row Source to "test1" in properties it> works fine. I've tried several ways of doing this in VB. Ideally I> would prefer it on the previous form for an onclick event. I've tried> putting the horse in front and behind the cart as so:>> db1.Form_searchlist.lstSearch = "test1"> DoCmd.OpenForm "searchlist">> And also:>> DoCmd.OpenForm "searchlist"> Forms!searchlist!lstSearch = "test1">> I even tried making it an onload event on the searchlist form, but> none of these work. I'm providing the same criteria in every way for> the query, so I should have results on the list box.>> Is there a way to do this that actually works?Try this:    DoCmd.OpenForm "searchlist"    Forms!searchlist!lstSearch.RowSource = "test1"-- Dirk Goldgar, MS Access MVPwww.datagnostics.com(please reply to the newsgroup)
0
Dirk
3/9/2007 6:53:43 PM
Hi.> Forms!searchlist!lstSearch = "test1"You haven't identified the RowSource Property for this combo box. Therefore, the default property, Value, will be assigned "test1," which doesn't work.> Is there a way to do this that actually works?Yes.  Try:    DoCmd.OpenForm "searchlist"    Forms!searchlist.lstSearch.RowSource = "test1"HTH.GunnySee http://www.QBuilt.com for all your database needs.See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.Blog:  http://DataDevilDog.BlogSpot.comhttp://www.Access.QBuilt.com/html/expert_contributors2.html for contact info.<requeth@gmail.com> wrote in message news:1173465788.777648.113520@v33g2000cwv.googlegroups.com...> Hello,>> I am trying to set the row source to a query in VB so it can be> dynamic depending on which option is chosen the previous form. The> user is on a form, enters data, chooses Ok, and I want the form with> the listbox to pop up, which it does. My problem is setting the row> source in VB. If I set the Row Source to "test1" in properties it> works fine. I've tried several ways of doing this in VB. Ideally I> would prefer it on the previous form for an onclick event. I've tried> putting the horse in front and behind the cart as so:>> db1.Form_searchlist.lstSearch = "test1"> DoCmd.OpenForm "searchlist">> And also:>> DoCmd.OpenForm "searchlist"> Forms!searchlist!lstSearch = "test1">> I even tried making it an onload event on the searchlist form, but> none of these work. I'm providing the same criteria in every way for> the query, so I should have results on the list box.>> Is there a way to do this that actually works?> 
0
69
3/9/2007 7:20:30 PM
On Mar 9, 1:20 pm, "'69 Camaro" <ForwardZERO_SPAM.To.69Cam...@Spameater.orgZERO_SPAM> wrote:> Hi.>> > Forms!searchlist!lstSearch = "test1">> You haven't identified the RowSource Property for this combo box.> Therefore, the default property, Value, will be assigned "test1," which> doesn't work.>> > Is there a way to do this that actually works?>> Yes.  Try:>>     DoCmd.OpenForm "searchlist">     Forms!searchlist.lstSearch.RowSource = "test1">> HTH.> Gunny>> Seehttp://www.QBuilt.comfor all your database needs.> Seehttp://www.Access.QBuilt.comfor Microsoft Access tips and tutorials.> Blog:  http://DataDevilDog.BlogSpot.comhttp://www.Access.QBuilt.com/html/expert_contributors2.htmlfor contact> info.>> <requ...@gmail.com> wrote in message>> news:1173465788.777648.113520@v33g2000cwv.googlegroups.com...>>>> > Hello,>> > I am trying to set the row source to a query in VB so it can be> > dynamic depending on which option is chosen the previous form. The> > user is on a form, enters data, chooses Ok, and I want the form with> > the listbox to pop up, which it does. My problem is setting the row> > source in VB. If I set the Row Source to "test1" in properties it> > works fine. I've tried several ways of doing this in VB. Ideally I> > would prefer it on the previous form for an onclick event. I've tried> > putting the horse in front and behind the cart as so:>> > db1.Form_searchlist.lstSearch = "test1"> > DoCmd.OpenForm "searchlist">> > And also:>> > DoCmd.OpenForm "searchlist"> > Forms!searchlist!lstSearch = "test1">> > I even tried making it an onload event on the searchlist form, but> > none of these work. I'm providing the same criteria in every way for> > the query, so I should have results on the list box.>> > Is there a way to do this that actually works?- Hide quoted text ->> - Show quoted text -Bah, I'm always screwing up some mundane detail! (That is not amundane Detail Michael!!!)
0
requeth
3/9/2007 8:01:04 PM
Reply:

Similar Artilces:

setting up new outlook mail account
i can not set up a new account on my outlook, i keep saying establish network connection with a correct sign but searching for my mail account shows X can you please advise Are you trying to setup a POP3 mail account or an Exchange account? Also, what version of Outlook are you using? "rashid" <rashid@discussions.microsoft.com> wrote in message news:C59D04C0-C1C9-4BD1-AE00-2009D25B221D@microsoft.com... > i can not set up a new account on my outlook, i keep saying establish > network > connection with a correct sign but searching for my mail account shows X > ...

How do I set up an argument which asks for multiple criteria
I am trying to use an argument that asks for one of three criteria (2345P, 8319T, or 7026J) in cell C108, and if it finds it, enters the amount of yet another cell, G108 into cell K108, and if not enters 0 into cell K108. It seems there are too many arguments for the "if" argument, and I can't seem to get the "lookup" argument to work either. Is there another argument I should be working with? Thanks -- Diver Try: =IF(OR(C108="8319T",C108="2345P",C108="7026J"),G108,0) "bj" wrote: > try in K108 > =if(or(c108=&qu...

OWA Set Rule problem
I have successfully install the Exchange 2003 with SP1 in the Windows Server 2003. Anything alright exclude the rules function in OWA. I try to set the rules from any then "move to" or "copy to" specify folder are no problem, but "forward to" other email address, its don't work. I try to input the email address in the contact and then select from the contact, but the result also don't work. The rules can save and I can receive the incoming email in the Exchange 2003/Outlook or OWA, but it don't forward to my specify email address. I try to...

How do I set the 'Set Synchronizing Client' field
We have a number of outlook clients using CRM that have the 'Set Synchronizing Client' select box greyed out. We need to tick them so that they are able to synchronize tasks etc. Can any one help me find out why these are greyed out and then set them so that they can synchronize thanks In my experience, that checkbox is always greyed out for the first install that is performed for a user. The only time that checkbox becomes active is if a second copy of CRM is installed for a user who already has CRM installed on another PC.... Normally the box is checked and grey. If that is...

Global Address list #40
Hi, i have: Windows 2003 SBS Exchange 2003 And Outlook 2003 clients Is there an option to edit or add recipients in the global address list, can i edit this items??? Thanks a lot what you add/edit/hide in active directory is what the GAL is going to show. "Daniel Vargas" wrote: > Hi, i have: > Windows 2003 SBS > Exchange 2003 > And Outlook 2003 clients > > Is there an option to edit or add recipients in the global address list, can > i edit this items??? > > Thanks a lot You add recipients by creating new mailboxes or contacts. Why do you want to ...

How to set backcolour
Hello All I have a continuous form containing a number field (long integer) called [v_colour]. This field contains the number of a certain colour - as per the numbers that are used in the format properties for back colour etc. I would like to set the back colour for the form's [v_colour] text box to be the value of the field: e.g. If the value of [v_colour] in the first record is 255, I want the back colour of the textbox for that record to be bright red. I tried this as the OnLoad event for the form: [v_colour].backcolour = [v_colour].value .... but this resulted in the back colour of...

Add New Group in Tasks List
Outlook 2007 On the Navigation pane in the Task list there is an "Add New Group" option. I have created a new group called Custom Views, but I have not been able to figure out how to add my custom views to the new group. What kinds of items can be placed in a group, and how do I add items to a group? Any help will be greatly appreciated. --Tom You can only place folders in the groups, not views. Show the Advanced toolbar and you can easily select the custom views. -- Diane Poremsky [MVP - Outlook] Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Soluti...

Forms Combo Box
Does anyone know haw to make the Forms Combo box font bigger?? No can do. You could try the Controls toolbox one, but not recommended if usin several controls because these ones are very buggy. More properties more trouble -- Message posted from http://www.ExcelForum.com ...

Display cell contents in a text box (shape) and linking
Dear Experts: below macro grabs the contents of cell B7 and displays it in a text box (shape, not a control!). How do I have to re-write the code to have the contents of the cell linked to the contents of the shape. That is, whenever the cell contents changes, the contents of the text box is to be updated as well. Help is much appreciated. Thank you very much in advance. Regards, Andreas Sub AddTextBox() ActiveSheet.Shapes.AddTextBox(msoTextOrientationHorizontal, 97.5, 28.5, 96.75 _ , 17.25).Select Selection.Characters.Text = Range("B7") With Sel...

Applying Percent Decrease Across Set Periods
I have a column which includes dates when items were purchased. I have used the DATEDIF function to find the number of years between that date and today's date. I now want to decrease the purchase amount 10% for every year calculated via the DATEDIF function. Any ideas, is this possible, why can't I think...? -- Hunt&amp;Peck ------------------------------------------------------------------------ Hunt&amp;Peck's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=32961 View this thread: http://www.excelforum.com/showthread.php?threadid=527873 ...

Set Regional Settings but not Language
Hi I have a multi-language APP en-US, es-ES, it-IT I usually change Languages and Locales by using the CultureInfo to switch Languages System.Globalization.CultureInfo myCI = new System.Globalization.CultureInfo("es-ES"); My issue is - what if the user wants to View App in english and use the Regional Options on a PC in say Spain ??? If I change the CultureInfo to en-US then they can view APP in English ( English satelite assemblies) but date and numbers will be in US format If I change the CultureInfo to es-ES then date and numbers will be in Spain forma...

Need Help Deleting Blank Rows
Greetings: I have a spread sheet with data that has multiple blank rows that I would like to delete with a macro. Each row of data is different with columns that may or may not be blank. Therefore, I cannot search on a specific column to delete the row. Any help is appreciated. -- Thanks in advance...j We need some kind of rule to follow to decide if a row is considered 'blank' or not. If not a single column, then perhaps empty cells in any one of several different colums, as if a4 is empty, or g4 is empty or i4 is empty, then delete row 4 completely, or a com...

Reading pane does not match message list
I've been using WLM desktop for a over a year with no problems at all. I just had to do a complete recovery on my PC, including an update to WLM 2009, which meant doing an export / import. All seemed to go fine. But, as of this morning many of my storage folders, but not all, show all the correct messages in the message list, but the reading pane always shows the same message. I first thought that it was the result of the import process, but I see that even messages I moved to the folders this morning are behaving the same way. I've even rebooted the PC, but I still ...

Importing marketing list
How do I import a marketing list into CRM without associating it with an Account, Contact or Lead? These are purchsed lists and will not become real leads until we run them through a campaign and get some campaign responses back. I just need to import an e-mail list into CRM and have the e-mail field populated (it could be associated with a Lead if there was no other option). When I import the list into a Marketing List, I have to associate it with something, so I chose Lead, but then it only provides me with the three fields Company Name, Last Name and Topic...there are no other fi...

can't resize a text box basic
I am creating some software flow diagrams. I add a box and try to add some text. I want the text to be on the box but it ends up being really long and I can't figure out how to re-size it. It ends up being too long. It disappears when I go back to working with the box. When I go to text mode then the text box is too long but I can't figure out how to delete it or resize it to fit on my box. Then I go back to the shape mode and the text box disappears. tia, Hello J, Have a look at this post: http://blogs.msdn.com/visio/archive/2006/08/15/694710.aspx If you haven't come a...

Reading Pane Settings
I did a search for an answer to this question and have not found one. If I missed an answer already posted, please direct me to the right place. I have Outlook 2007 and set up the "right" reading pane for my e-mail. Now when I go to my calendar it is set up the same way - calendar on the left (same size as the inbox) and then there is a blank space to the right that is the size of the reading pane/preview. To the right is the to-do bar (which I have no problem with). I don't know why there is a reading/preview pane on the calendar when there is nothing to preview, and I...

Work Hours setting excludes specified hours from Scheduling
I am miffed by this problem. I specify a work hour schedule for a user. When I schedule a CRM User as a Resource for a Service in Scheduling of a Service Activity with Requested Time of ASAP and click Find Available Times, the values for Avilable Times returned are outside of the Work Hours I specified for the user and not within the work hours. When I drill into the Work Hours for this User, the Calendar view shows Cross Day rather than 8:00AM - 5:00PM I speciied for work hours and editing the hours reveal the correct hours in the Work Hours. What gives? Never mind. Figured out w...

Sharepoint and updating of excel lists
Anyone might have any clues on this in this group: http://groups-beta.google.com/group/comp.lang.perl.misc/messages/ab36a40dd1db9436,7a8401f8cb7b72d4?hl=en&thread_id=c128d640408327db&mode=thread&noheader=1&_done=%2Fgroup%2Fcomp.lang.perl.misc%2Fbrowse_frm%2Fthread%2Fc128d640408327db%2F7a8401f8cb7b72d4%3Fhl%3Den%26#doc_ab36a40dd1db9436 Hoping we have some perl mongers in this group :-) Dave wrote... >Anyone might have any clues on this in this group: .... Did you try using use Win32::OLE::Const 'Microsoft Excel'; ? If so, what did the statement printf &quo...

Outlook "Arrange By" option does not retain its setting
In outlook 2007, I use a custom view for my inbox, and I have the Group By option checked to"Automatically group according to arrangement." This has been workn flawlessly until today, when I realized Outlook did not like a particular mouse click; perhaps I clicked on the border of two options or some other anomoly that caused the window toflash once. The end result was that my Arrange By option changed to "From" when I had previously set it to "Conversation." Now, whenever I hange it backto "Conversation," leave the inbox and come back, ...

interactive buttons, multiple sets
hi folks I'm sure one of you good folks will save my bacon as usual I have a series of websites, all of which exhibit the same odd behavior with interactive buttons. I have a bunch of buttons in the left margin, each of which pulls up ( lets call it ) a chapter, and in each 'chapter' are a number of related pages. On the top of each page is an imbedded page which has 'page numbers' for all the 'pages' in that chapter. So, it's a grid where the 'vertical' buttons in the left margin and the 'horizontal' buttons at the top comb...

How do I set OOR
I have searched the help menu and have had no luck finding out how to set my outlook 200 to send an OOR (Out of Office Reply) Any assistance would be great If you are in an Exchange environment (ask your administrator if you do notknow) you can set the Out of the Office Assistant which is located under Tools. If you are not in an Exchange environment you can create a rule that replies on all e-mails. The downside of this is that you'll have to have your Outlook open all the time for the rules to process. Make sure you set some exceptions (for instance based on the subject field so ...

Set Focus
I have text box that I input data into and I was wondering if it is possible to set focus to the text box and avoid clicking on the box. I thought the term is Set Focus, but can't find any information or example that would help in doing so. Any help would be appreciated .. PPT 2003. Look at the following page for code to set focus on a text box: http://officeone.mvps.org/vba/activate_shape.html - Chirag PowerShow - View multiple PowerPoint slide shows simultaneously http://officeone.mvps.org/powershow/powershow.html "Phil K" <PhilK@discussions.microsof...

Help Please with Dropdown lists and Vlookup
How can I integrate using a multiselect dropdown list and vlookup function? I have gone to "Contextures" website but do not see this type of example. I am trying to setup a form with a couple of list boxes where if I select the first box and select an item(s) they will be filled in the adjoing cell and the other list boxes will be populated with the data pertaining to the item selected in the first list box. Any help or reference to any site will be greatly appreciated. Hi Totally Confused, You say that you have looked at the Contextures site, but did you look at Debra Da...

Set published amount of calendar information
Hey guys! Is there any way I can have Exchange 2000/2003 force the amount of time published in the outlook calendar? I know that you can go into the the calendar options and set the amount you want published, but is there a way to have exchange require the amount that is published so that I could get everyone to publish a year's worth of calendar data instead of one person being set at 2 months and another at 6 months and another at 12? Thanks! Mike On Thu, 29 Jun 2006 06:18:02 -0700, Mike <Mike@discussions.microsoft.com> wrote: >Hey guys! > >Is there any way I c...

Outlook contacts list issue
I am in the process of recovering data from an anchange disaster. I had all of the mailboxes recovered and are all in PST files. I am now going through and showing users how to import their calendars, contacts, mail etc. When a user imports his/her contacts, everything goes fine until they try to use those contacts through the address book. The address book does not show any contacts added by the import. Any newly created contacts are visible. I have found that if I change the email address of an imported contact, that contact will then appear in the address book. This indicates ...