473,473 Members | 1,730 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

using requery on 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 know 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
2 1918
One way to do it would be to build your sql statement as a string variable
and then assign that to your subform's recordsource property.

form.subform.form.recordsource = sqlstring

Wes

<cm******@ufl.eduwrote in message
news:11**********************@74g2000cwt.googlegro ups.com...
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 know 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 25 '06 #2
cm******@ufl.edu wrote:
i know 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
Another thing that might help is that when using subforms you can't
access the subform controls directly (or at least I haven't figured out
how). You have to go through the main form.

You may want to try something like:

docmd.requery Forms!frm_MainForm!subfrmindividual,,strwhere

Or even use a Filter instead:
Forms!frm_MainForm!subfrmindividual.Form.Filter = "..."
''Note: enter where criteria without the "where"

Cheers

Aug 25 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

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...
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...
3
by: google | last post by:
I'm developing an application for use within my company in Access 2003. I'm new to '03, the application I did for my former employer was in '97. The two applications have similar functionality...
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...
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...
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...
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...
4
by: JHite | last post by:
I am using Access 2003 on Windows XP. This is a simple database that contains “tblStaffers” containing names of the office staffers, “tblProjects” containing names of the office projects, and...
3
by: Kan09 | last post by:
i'm having a problem with the requery and move to last command on some subforms. The subforms are used to view the data enterd into the table. I have 3 forms that use subforms. On 2 of the...
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...
1
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.