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

Switching between two forms with ease - URGENT!!

Status
Not open for further replies.

shortone

Programmer
Mar 6, 2002
45
US
Hello all!
I have a db that has two data entry forms, which, due to changes in the law (we are in State gov't.), are based upon two different tables (there is no way to put them both in the same table). The user wants to be able to switch between the forms, without having to close one and open the other. I've put buttons on each form that will open up the other form. The problem comes when the user tries to search for a record in the original form opened, after the second form is opened (everyone with me so far? [ponder]). When she (the user) tries to search for a record, the program freezes up entirely.

Question: Why does this happen and how can I fix it? I really need to get this fixed, because I'm going to have a new db to develop very soon. [bugeyed] Thanks in advance!
JayeD
"I'm sure of two things: there IS a God, and I'm NOT Him!" - R. Williams
 
I put a "Find Record" button on the forms. JayeD
"I'm sure of two things: there IS a God, and I'm NOT Him!" - R. Williams
 
There shouldn't be any reason you can't do this type of search when two forms are open at the same time. Are either one of the form's properties set to MODAL?

prodevmg@yahoo.com
ProDev, MS Access Applications B-)
May God bless you in the year 2002.
 
Thanks for your reply. No, the forms are both pop-up, but not modal. I've made these forms so SIMPLE for her to use (click a button to open, click another one to close, etc.). There's really no need for her to have both forms open at one time, but that's a whole loooong story that we won't get into. If one of the forms is closed and she searches, everything's fine. The problem only occurs when both forms are open and she clicks the "Open ____ Form" to switch between the forms. Would it be better to put some code in that will close the current form after the button is clicked? Maybe that would solve the problem (and she'd be none the wiser)?[wink] JayeD
"I'm sure of two things: there IS a God, and I'm NOT Him!" - R. Williams
 
Yeah, try that.

On formA, in the 'on click' event of the 'openFormB' button-
immediately after the 'on error' line of the code put in:-

docmd.close

then in same place on FormB within 'openFormaA' button put in the same.

docmd.close
-
Each form should close automatically without the user knowing.
 
Sounds like a plan to me! That's what I was thinking - thanks!! ;-) JayeD
"I'm sure of two things: there IS a God, and I'm NOT Him!" - R. Williams
 
I just want to let you know that everything works and tell you what I did:
After some general housecleaning of old code, I put the DoCmd.Close line where you suggested, then followed that with DoCmd.Minimize, so my user won't sit there looking at the database window and try clicking on something while the form is loading (it's slow, because both the back-end and her copy of the front-end are on the server. At least I THINK that's the reason!). Then, after the OpenForm event, I put in DoCmd.Maximize. It works, she can search and flip back and forth between the two forms with the click of ONE button.

I'm very grateful for your help and that of all the others in these types of forums (since there's no one in this office who knows anything about Access, coding, etc.).
[lipstick] JayeD
"I'm sure of two things: there IS a God, and I'm NOT Him!" - R. Williams
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top