Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Main Form and Subform Updating Issue 2

Status
Not open for further replies.

smicro

MIS
Dec 26, 2002
281
US
I have a main form with a list box to select properties. My subform contains potential clients for the properties stored in a different table. Both forms are working good and linking. On the subform I have an option group when based on what selected will show/disappear additional text boxes. The problem comes in when I select a property on the main form, the option group on the subform is updated for each specific property which is good, but the text boxes don't appear/disappear unless I click on one of the buttons in the option group. So lets say property 1 in the list box main form has an option group equal to yes in the subform than another text box appears. Property 2 equals no. When I switch from Property 1 to Property 2 the text boxes will still show. When I select between records the text boxes aren't appearing/disappearing like they should. If I click on the option group itself everything works great they appear and disappaear but when I switch between records it seems as though the form isn't rereading the .visible=true etc. I tried to requery the form,subform and tried to requery the frame for the option group itself but nothing seems to have worked. Hope I explained this right Any help would be great, thanks.
 
It sounds as if you are initiating the Visible=true in the OnClick event of the Option Group. If that is the case then you would expect the code you made to Hide/Show the text boxes not to execute, because the Option Group did not experience the OnClick event.

Maybe try a different route like using the OnTimer event to check the Option Group value periodically to see if the value has changed

Hope that helps.
Vince
 
Hi Vince, yes your are exactly right. I tried the ontimer event before and got it to work. I wasn't sure if that was the proper way to do it but it looks great. Thank you!
 
I'd put code in the Current event procedure of the subform instead of the Timer one.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks PHV, that has worked also, as usual thanks again!
 
PHV,
I meant to ask the reason you not put it in the timer even though it works. Is that for performance issues? Thanks.
 
Because it's wasting resources most of the time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top