473,401 Members | 2,139 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,401 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 3516
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.