Connecting Tech Pros Worldwide Help | Site Map

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

 
LinkBack Thread Tools Search this Thread
  #1  
Old June 15th, 2006, 01:25 PM
MLH
Guest
 
Posts: n/a
Default Sometimes when I attempt to refresh records in a subform control on the main form - it doesn't work

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?

  #2  
Old June 15th, 2006, 01:35 PM
MLH
Guest
 
Posts: n/a
Default 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]

  #3  
Old June 15th, 2006, 01:55 PM
MLH
Guest
 
Posts: n/a
Default 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???
  #4  
Old June 15th, 2006, 02:15 PM
Rick Wannall
Guest
 
Posts: n/a
Default 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.
  #5  
Old June 15th, 2006, 03:25 PM
salad
Guest
 
Posts: n/a
Default Re: Sometimes when I attempt to refresh records in a subform controlon 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
  #6  
Old June 15th, 2006, 06:55 PM
MLH
Guest
 
Posts: n/a
Default 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.
  #7  
Old June 15th, 2006, 06:55 PM
MLH
Guest
 
Posts: n/a
Default 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.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.