|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hello All,
I have a bit of a problem. I have a main form with two subforms. The subforms are linked to the main form my two fields. The main form and subforms are each based upon a different query. I have written VBA code that filters the SQL statements of the subforms based upon the value of the the REV field on the main form. When the user changes to different record on the main form, the subforms are supposed to change accordingly. The problem is that the subforms on the main form will not refresh each time the user chooses a new record on the main form. If I change to a new record on the main form and then open the subform outside of the main form, the correct information is shown on the subform. The problem is that the subform does not automatically refresh in the main form. I have tried numerous strategies, but to no avail. If I am on a record in the main form, and I exit the main form, and then re-open the main form, the subform data on the main form will reflect that of the record I was on prior to previously exiting the main form. Here is some of the code that I have tried: Me![qryRevText_ sf].Form.Requery Me![qryAdminRevText_sf].Form.Requery Me.Refresh or Me.[qryRevText subform].Form.Refresh Me.[qryAdminRevText subform].Form.Refresh or DoCmd.Close acForm, "qryRevText subform" DoCmd.Close acForm, "qryAdminRevText subform" Please help me if you can. I would appreciate it greatly. Thank you in advance. Akagami Last edited by Akagami : July 19th, 2006 at 01:20 PM. Reason: needed more descriptive title |
|
#2
|
|||
|
|||
|
I don't know an answer, sorry, but there is an excellent VBA/Access section at www.mvps.org. You may find some answers there.
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
|
#3
|
|||
|
|||
|
Thanks Doug. I will try that site.
|
|
#4
|
|||
|
|||
|
EddyJawed
[QUOTE=Akagami]
Akagami - change the sourceobject of your subform before you requery it, Repaint the whole form, recalc the whole form then change the sourceobject of the subform back to the original query. I don't know why but this works! |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Subform won't refresh |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|