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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UPDATING A FORMS CONTROLS FROM ANOTHER FORM

Status
Not open for further replies.

Kevsim

Instructor
Apr 18, 2000
385
0
0
AU
I have updated the controls in Form “A” then I update the form, I then want to update the controls in Form “B”. I have added the code in Form “A” After Update, “Forms![F_Search Parts]![Combo10].Requery” and this updates Form “B” controls OK, providing Form “B” is open. If Form “B” is not open I receive the error message “Access can not find the form [F_Search Parts] referred to in the macro or visual basic”. I add in the Event Before Update of Form “A” to open Form “B”, this works great, except Form “B” opens on top of Form “A”. Is there a way to update the controls in Form “B” without opening Form “B” or if I have to open Form “B”, it does not open on top of Form “A”.
I would appreciate any assistance.
kevsim
 
You can use acHidden for window mode when you open the form B.

Hope this helps...
 
jitter, Thanks for the info, however I can not make it work, what other code would have to be included?
kevsim
 
I have found the answer, if I add the code below, when I open Form "B", using the event, BeforeUpdate,and adding the code just after the form open command, the form opens allowing updating but is not visible and I can view Form "A" without any problems.
With Forms!F_SearchParts
.Visible = False
End With
kevsim
 
Hey Kev,
That is pretty slick. What happens to focus though? Does it stay on form a, or go to hidden form b. Did you manually set focus again to form a?

just curious

tammy
 
tammyf1964, Thank you for the question, the focus stays on Form "A" as this is they way I wanted it to be. If I then open FOrm "B" from the Switchboard and not from the code in form "A", the focus is then on Form "B", once more the way I wanted it.
kevsim
 
Kevsim (Instructor)
Can you send me an example of your code.

Thanks
Always Grateful
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top