A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How do I 'repaint' a subfom?



 
 
Thread Tools Display Modes
  #1  
Old February 8th, 2006, 12:02 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default How do I 'repaint' a subfom?

Main form (Form1) subform on Form1 (Form2).
List boxes in both forms , tables are linked.
Form 2 list box has a QUERY to filter records depending on which record is
selected in Form1 list box.
How do I repaint the Form2 (subform) listbox as I move from record to record
in Form1 listbox.
I can do this as 2 separate forms by running a Macro which closes/opens
Form2 every time I click on a record in Form1 listbox.
The relationship between Form1 and Form2 tables is one to many.
  #2  
Old February 8th, 2006, 01:46 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default How do I 'repaint' a subfom?

Using the Current event of the main form and the AfterUpdate event of the
listbox on the mainform you need to requery the listbox on the subform. The
requery code should look something like this:

me.sfrmForm2.form.MyList.requery

replace 'sfrmForm2' above with the name of the subform control on the main
form. This is not necessarily the same as the name of the form object that
is referenced in the ControlSource of the subform control. To be sure, open
the main form and click once on the subform then check the name property
under the Other tab. Whatever you find there is what belongs in place of
sfrmForm2.

If the main form's listbox is bound to a field in the main form's rowsource
then putting the code in the main form's current event will ensure that the
subform's listbox is requeried each time record navigation occurs.

--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.


simcon wrote:
Main form (Form1) subform on Form1 (Form2).
List boxes in both forms , tables are linked.
Form 2 list box has a QUERY to filter records depending on which
record is selected in Form1 list box.
How do I repaint the Form2 (subform) listbox as I move from record to
record in Form1 listbox.
I can do this as 2 separate forms by running a Macro which
closes/opens Form2 every time I click on a record in Form1 listbox.
The relationship between Form1 and Form2 tables is one to many.



  #3  
Old February 8th, 2006, 03:51 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default How do I 'repaint' a subfom?

thank you very much for your help. I have only spent last 3 days trying to
get this to work!

"simcon" wrote:

Main form (Form1) subform on Form1 (Form2).
List boxes in both forms , tables are linked.
Form 2 list box has a QUERY to filter records depending on which record is
selected in Form1 list box.
How do I repaint the Form2 (subform) listbox as I move from record to record
in Form1 listbox.
I can do this as 2 separate forms by running a Macro which closes/opens
Form2 every time I click on a record in Form1 listbox.
The relationship between Form1 and Form2 tables is one to many.

 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Toolbar repaint issue ... Joe Using Forms 0 January 30th, 2006 08:59 AM
Repaint ? an Using Forms 2 September 27th, 2005 06:54 PM
Repaint a form with a TreeView Object Mauricio Silva Using Forms 0 January 25th, 2005 06:55 PM
Repaint a form Warrio Using Forms 2 September 14th, 2004 02:22 PM


All times are GMT +1. The time now is 06:02 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.