Connecting Tech Pros Worldwide Forums | Help | Site Map

Sometimes when I attempt to refresh records in a subform control on the main form - it doesn't work

MLH
Guest
 
Posts: n/a
#1: Jun 15 '06
I don't always get what I want when I invoke the following

Me!MySubFormControl.Refresh

from code running in the main form. Am I doing something
wrong here? Someone suggested that I open the subform
itself (as a separate form) in hidden view anytime I open
the main form and attempt my refreshes there. I think that
is somewhat redundant and can't be what MicroSoft intended.

Comments?

MLH
Guest
 
Posts: n/a
#2: Jun 15 '06

re: Sometimes when I attempt to refresh records in a subform control on the main form - it doesn't work


Excuse me... I meant Requery ==> not Refresh

On Thu, 15 Jun 2006 09:26:12 -0400, MLH <CRCI@NorthState.net> wrote:
[color=blue]
>I don't always get what I want when I invoke the following
>
> Me!MySubFormControl.Refresh
>
>from code running in the main form. Am I doing something
>wrong here? Someone suggested that I open the subform
>itself (as a separate form) in hidden view anytime I open
>the main form and attempt my refreshes there. I think that
>is somewhat redundant and can't be what MicroSoft intended.
>
>Comments?[/color]

MLH
Guest
 
Posts: n/a
#3: Jun 15 '06

re: Sometimes when I attempt to refresh records in a subform control on the main form - it doesn't work


Also... Tried to use Link Master Fields and Link Child Fields.
A97 err'd saying "Can't build a link between unbound forms"
Not quite sure how to bind 2 forms. Hmmm???
Rick Wannall
Guest
 
Posts: n/a
#4: Jun 15 '06

re: Sometimes when I attempt to refresh records in a subform control on the main form - it doesn't work


You don't exactly "bind 2 forms".

To form a link between two forms at least one of the forms must have a
recordsource. It must be "bound to" a source a of data. Both forms can be
bound to data, but only one must.

The link comes from having some value on one form (such as a customer key,
an order key, a class key) used to retrieve records to be displayed in the
other form. If "the other form" is not bound to a recordsource, there ARE
no records to retrieve and so the definition of a link between them becomes
meaningless.

The typical arrangement is to have a main form that is either bound to some
data (customer table, order table, etc) or is unbound but presents a listbox
or combobox that you use to select some record for which you want to view
data out of another table.
salad
Guest
 
Posts: n/a
#5: Jun 15 '06

re: Sometimes when I attempt to refresh records in a subform control on the main form - it doesn't work


MLH wrote:
[color=blue]
> Also... Tried to use Link Master Fields and Link Child Fields.
> A97 err'd saying "Can't build a link between unbound forms"
> Not quite sure how to bind 2 forms. Hmmm???[/color]

Why not Use Filter/FilterOn?

You are on a record on MainForm. There's a field you can link to called ID.

Forms!MainForm!Subform.Form.Filter = "ID = " & Me.ID
Forms!MainForm!Subform.Form.FilterOn = True
MLH
Guest
 
Posts: n/a
#6: Jun 15 '06

re: Sometimes when I attempt to refresh records in a subform control on the main form - it doesn't work


Understood perfectly. I was
running into probs because
my main form was not bound.

I have used a work-around.

Thx.
MLH
Guest
 
Posts: n/a
#7: Jun 15 '06

re: Sometimes when I attempt to refresh records in a subform control on the main form - it doesn't work


Understood perfectly. I was
running into probs because
my main form was not bound.

I have used a work-around.

Thx.
Closed Thread