SEARCH YOUR SOLUTION HERE  

Listbox selections requery subfrm

I have a form that has names with a subform with information. The contacts are in a list box and the subform (in datasheet view) shows the phone number/email/etc.. of the selected contact person. I am using the form as a quick look up of a persons information. Before changing it to a list box, it was previously a combo box, and everything worked fine. i was able to requery the subform and the cooresponding info for the person would come up. However, its now a list box and i am having problems with the code to make this happen. I have a different button sending the names selected from the list box to a report...and that works fine, but i am obvisouly missing something to make it work with the subfrm requery. Below is the code i got so far. Any help would greatly be appreciated. its driving me nuts!

Private Sub QuickLookup_Click()
Dim varItem As Variant
Dim strWhere As String
strWhere = "[memberID] = "
For Each varItem In Me.MemberID.ItemsSelected
strWhere = strWhere & Me.MemberID.ItemData(varItem) & " OR [memberID] = "
Next varItem
strWhere = Left(strWhere, Len(strWhere) - 17)
DoCmd.Requery "subfrmqryindividual"

Posted On: Monday 22nd of October 2012 05:32:40 AM Total Views:  287
View Complete with Replies




Related Messages:

Creating a "average" listbox   (106 Views)
, I was wondering if it was possible to create a average list box in a form sheet For example, I want to create another listbox underneath the 3rd box to average out what I have circled. Is this possible to do in access For example: I have a box with a list of depths such as 1200,1000,3000,4000,5000. Can I create another list box underneath taking the average of these 5 numbers
Automatically update/refresh/requery a subform   (206 Views)
, I have a form and on this form there sit two subforms. Subform1 Subform2 The main form and the two subforms are all linked via parent/child relationships. So that when the Data in the main form is changed, the relevant data is shown in the two subforms for the same Site. Now, I have a Button in Subform1. When this button is clicked it updates a set of data to a column in Table1. Subform2 is there to show this updated data from Table1. However, currently it wont refresh or requery automatically. I have to go to another record and come back for the fresh data to show up. What I want is as soon as the button is clicked on Subform1, Subform2 should update instantly. How can I do that I tried on the ONClick even of the button to put this: If CurrentProject.Forms("Subform2").IsLoaded Then Forms![Subform2].Requery End If That didnt work I also tried on the OnClick Event to put this: DoCmd.RunCommand acCmdSaveRecord That didnt work. Please help.
Percentages are showing up as decimals in my listbox   (112 Views)
On one of my computers the list box shows the percentages properly but when I test it out on another computer, the percentages show as decimal. The field in the table where the value is retrieved from is set to Decimal, Percentages. I want .5625 to show as 56.25% I think it's something in the settings for Access, but can't see to find it. Hopefully it's not a system setting because I don't want to have to keep changing it when I go from one system to another.
Populating a listbox by making a combobox selection   (115 Views)
I am learning by doing and y'all have been helpful before. I am stumped. I am familiar with the QBF concept and am using it as the basis for what I am attempting. Below is the code I have created to populate a listbox by making a combobox selection. I want to show values in a list box (List2) when I make a selection in a form-based combobox (Combo0). The code is a stored procedure in the AfterUpdate event for the combobox on the form [Forms]![Form1]![Combo0] However the listbox (List2) does not show the table values (tblClientRecords.name ) when using the combobox (Combo0) only when I switch from design mode to form mode. If I build a query with the same exact statement the query returns the result I expect. Otherwise it doesn't work. I hope this makes sense - what am I missing thanks in advance! /jh Code: mySQL = "SELECT tblClientRecords.client, tblClientRecords.group, tblClientRecords.name FROM tblClientRecords WHERE (((tblClientRecords.name)=[Forms]![Form1]![Combo0]));" Forms!Form1.List2.RowSourceType = "table/query" Forms!Form1.List2.RowSource = "mySQL"
requery on exit w no code   (89 Views)
I have a strange problem. On some forms with listboxes, when I close (via a close button) the listboxes want to requery after the form closes prompting a parameter box to pop up. I have no code inserted to do this. If I file-close, it works fine. However some users don't report this to happen on their PC's. are supposed to be set up the same though with me as an exception (having it fully installed). I tried converting it to 2000 then back to 2002 (after trying compact-repair) which did fix it for me opening holding the shift key, but not if I open it like else. We just got new PC's running XP pro from 2000. Access version is 2002 and did not change. Any ideas Our internal programmer is stumped as am I. He just says "that's why Access shouldn't be used for anything". I develop basic apps in Access and he hates it so I have to make sure it's perfect before rolling things out or I'll be back to the stone ages.
A listbox access 2010   (125 Views)
I have a listbox on my form and I need to be able to enter a number in the listbox and it displayed in a report. I'm new at this and I need help with the code. there is one list-box and a preview report bottom... my code for the preview report bottom DoCMD.close asReport,"Daily SCheduling Report", acSaveNo DoCMD.OepnReport "Daily Scheduling Report", acViewReport,Wherecondition=strwhere (it works) at this time my list-box is where I have go through 280 numbers to find or select the one that I need for my report. Is there any easy way to do this.
User is forced to first record upon requery after deleting a record   (104 Views)
I have the following code in a form which will delete a record from a table; however, upon the requery it takes the user to the first record of the form. How can I capture and move the user to the next record if one exists (or last record if one doesn't) instead of making them move to the first record Code: DoCmd.RunSQL "DELETE FROM [mytable] WHERE [recordID] = " & Me.recordID Me.Requery
Multiple selections in a listbox   (66 Views)
I have a listbox with about 8 different choices. i want to be able to query what is selected in this list box but I need to be able to select more than one choice so that my employees don't have to create multiple forms for the same item. Is there any way to select more than one option It would help greatly even if I have to add code in VB I will figure out how to do it,
Simple problem with listbox   (71 Views)
Hi all, I have a listbox contains item ID. When selected and hit the OK button it will return the selected ID. That is working fine for me, but I also want, if the user click the OK button without an item ID selected. It will pop up the MsgBox asking for an item ID selection. In the code, I have: If (Forms![ItemIDSelection]![ItemList] = Null) Then MsgBox ("Please select an ID") End If Why is the above code not working Using debug, the value of the Forms![ItemIDSelection]![ItemList] is Null but it never goes into the MsgBox ("Please select an ID") line. Please help.
Requery value of combo to listbox   (300 Views)
, I have a form with a text box, a combo and a listbox. The textbox stores the name of the user. The combobox gets its data from a query. I would like that when I open my form, by default the list box will show all the records of a table named Master and then, I would use the combo to requery the list by selecting another user. records under that criteria, will have to show up in the list box.