473,322 Members | 1,379 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

requery subform

Previously i had a combo box where i could select a name and then click a button and a subform on that form would requery and give me the information i wanted.
However, i have now changed the combo box to a list box...and am having a difficult time integrating the requery feature.
in short i have

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)

i now how to write the next line if i was sending this info to a report. however, i have not been able to figure out how to make a command that will requery the subform.
i have tried docmd.requery "subfrmindividual",,strwhere
and i get errors.
can anyone help....please!
caleb
Aug 24 '06 #1
1 3511
MMcCarthy
14,534 Expert Mod 8TB
The code you are using is the code used to run through selections in a multi select listbox. Try this as your link criteria:

strWhere = "[MemberID]=" & Me.MemberID.Value

This assumes MemberID is the name of your dropdown box and the bound column of your dropdown box.

By the way this will only result in one members records appearing in the subform as you can't multi select a drop down box.


Previously i had a combo box where i could select a name and then click a button and a subform on that form would requery and give me the information i wanted.
However, i have now changed the combo box to a list box...and am having a difficult time integrating the requery feature.
in short i have

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)

i now how to write the next line if i was sending this info to a report. however, i have not been able to figure out how to make a command that will requery the subform.
i have tried docmd.requery "subfrmindividual",,strwhere
and i get errors.
can anyone help....please!
caleb
Aug 24 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the...
2
by: F. Michael Miller | last post by:
I need to requery a subform from a third form and can't seem to get it to work. frmForm1 has frmAddress as a subform. The button cmdReviseAddress opens the form frmUpdateAddress where all of my...
3
by: ken | last post by:
Hi, I have a main form with a text box and a filter button. I also have a subform in the main form. When I make an entry into the filter text box and click the filter button, I change the query...
1
by: BartonConstruction | last post by:
Greetings all, I have a main form (frmClients) with two subforms (subVisits) (subAccount). I got the subforms to reflect what the main form is showing by linking master and child fields (I...
14
by: Kurt | last post by:
I have an unbound main form with an unbound subform. frmProjects fsubProjectList Using combo boxes, the user can select several search criteria on frmProjects and then click a command button....
1
by: Parasyke | last post by:
I have a subform within a tabpage that will requery/refresh (?) if I press F9 and it will update the data in the subform, but I have tried various combinations of Me!SubformName.requery...
4
by: midlothian | last post by:
Hello, I have conditional formatting set up on a subform based on a calculated value in the underlying query. For instance, if Sales are >$1000, the query displays "Yes," otherwise it displays...
6
by: MarkoBBC | last post by:
Hi everyone, First a brief description of my form: I have a subform within a main form. In my subform, I have a listbox displaying address information by firm name. A user first has to select a...
11
by: mrowe | last post by:
I am using Access 2003. (I am also using ADO in the vast majority of my code. I recently read a post that indicated that ADO is not all that is was initially cracked up to be. In the back of my...
2
by: mslagle1 | last post by:
Hi all, I am trying to requery a subform "frmOpenWorkOrders" when a value list "status" on my main form "frmWorkOrderMain" is changed. If I change "status" then click on "frmOpenWorkOrders" and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.