subform wont refresh??

dvh

Registered User.
Local time
Today, 23:02
Joined
Aug 23, 2006
Messages
28
hi all,
got a tricky problem...hope to get help from u all...appreciate!!!

i almost complete this but run into a "refresh" problem..I have a mainform with a textfield where users can input a number to search for an item; if found, a list in the 1st subform will appear in datasheet view. When i select a item in the 1st subform, if the item has a child, the 2nd subform will show the item's child/children.
I try to do this by passing a parameter from a MasterPno-Link field(linked to Partlist field in the 1st subform) on the mainform to a query that the 2nd subform is based on. The problem now is when i select a record on 1st subform, the 2nd subform doesnt refresh to show the corresponding number although it always shows the first item corresponding with the 1st item in the 1stsubform.
I tried to use this code on AfterUpdate event of MasterPno_Link. No error but no update..
Private Sub MasterPno_Link_Change()
Dim ctlList As Control
' Return Control object pointing to list box.
Set ctlList = Forms!submain1
' Requery source of data for list box.
ctlList.Requery
End Sub

I also tried this Form!submain1.Requery but didnt work

what am i doing wrong? pls enlighten me! thanks alot. Hope i make myself clear:)
 
Last edited:
First thanks a lot for a very quick reply...I have seen your other posts and all are very helpful. The bookmark u sent, i have seen but i dont completely understand..:o
Anyway, i tried the systax but still didnt work.I substitute "SubFormControlName" with "MasterPno-Link" where it will show a Parlist number when users select an item and the 2nd subform supposed to get this updated Partlist number.
This MasterPno-Link field is used to link 1st and 2nd subform and it's set to invisible on the mainform.
Any idea on different syntax? should i put the syntax in code or in event directly?
thanks again
 
Looks like I dropped the ball on this thread. I hope you were able to resolve your issue. Sorry.
 
assuming both subform1 and subforms2 are children of the mainform. then in the oncurrent event for the first subform, set some sort of global variable (used to drive the second subform), and then you can just do

me.parent!subform2.requery, i think
 
RuralGuy

Just what I was looking for... thank you very much

R~
 

Users who are viewing this thread

Back
Top Bottom