Popup troubles

ellenr

Registered User.
Local time
Today, 11:09
Joined
Apr 15, 2011
Messages
400
I surely do wish I had never embarked on a rewrite! I decided I must be better writing Access now than I was back before the turn of the century when this db was written, that after I made a requested change and got it working, I would make it more professional looking. Bad idea! In order to get the input forms centered for the various screen sizes, I have made them popups. I have everything working except one form and I would like to know why. It has one main form with two subforms. After the many details are entered on main (think scratchpad), a price is entered for the total number of pieces and it appears as a new line in subform #1. After each set of details is entered, each adding an additional line in the subform, an applied percent is entered and the grand total for that employee's piecework appears in Text99. It has been working smoothly for many years. If I make the form a popup, it cannot find text99 (unbound on the main form) to requery, and the error "There is no field named "Text99" in the current record" appears.

Any ideas? I can leave it as a non-popup form or keep searching for a workaround, but would truly like to know why it won't work.
Thanks
 
Show the code block which make trouble.
 
It would help to know which version of Access you are using.

I surely do wish I had never embarked on a rewrite! I decided I must be better writing Access now than I was back before the turn of the century when this db was written, that after I made a requested change and got it working, I would make it more professional looking. Bad idea!

Before I started making any UI changes to my Access 2003 and older apps, I spent a lot of time testing the UI features of 2007 and later. I really like the new features in 2010 and later for making Access look more modern and professional.

I discovered it was much better to completely recreate the forms from scratch. Not just give them a new coat of paint with the new UI features.



In order to get the input forms centered for the various screen sizes, I have made them popups.

I center my forms all the time and they are not set to pop-up.

FWIW: I rarely set a for as a pop up. I have never had the need to force the user to follow only a single path. I like to make my application my more flexible. Taking full advantage of Object Based design.


With 2007 and later I have switch to using the Tabbed documents not the overplayed. I not heard a single complaint out of 100's of user. All feedback has been they prefer it.



When I do need to center a form I use this:

Centering a form in the Access window
 
Oh, wow, HiTechCoach! This is exactly what I need if I can get it to work. I called the function in onLoad, then tried it in the OnOpen Sub (Call gfncCenterForm(Me)). It opens the form to its original design size (obviously what I wanted) but doesn't center it. It also unmaximizes the underlying form (not what I want). What am I missing? Your cute sample works perfectly. I have all my other little input forms working correctly, but this one behaves strangely as a popup and I haven't been able to figure out why--therefore the reason I am so pleased to see your post. Thanks!

I have both Access 2010 and 2016, and the client uses 2013, so I pretty much stick to 2010.
 
Backup the database. Create a new form then select everything on the original form and copy and paste to the new form. Copy the code to the new form's module. Delete the old form and rename the new one to the original name. Don't rename the old form because NameAutoCorrect will screw up everything if it is turned on (it is by default).

BTW It is a good idea to import everything into a new database after making a lot of changes. It clears out the cobwebs.
 
I have done as you suggested. The form in question (frmpwrk) is opened by click of a button on the main menu form. I changed the call to gfncCenterForm(Me) to the OnFocus event of frmpwrk, since OnOpen didn't get the job done. It opens maximized. I added a button to center it like in your example with the call to gfncCenterForm(Me). The first time I click it, the form goes to its design size from max, but stays in upper left corner, and at the same time unmaximizes the background form. The next click of the button finally centers it.
 
I have done as you suggested. The form in question (frmpwrk) is opened by click of a button on the main menu form. I changed the call to gfncCenterForm(Me) to the OnFocus event of frmpwrk, since OnOpen didn't get the job done. It opens maximized. I added a button to center it like in your example with the call to gfncCenterForm(Me). The first time I click it, the form goes to its design size from max, but stays in upper left corner, and at the same time unmaximizes the background form. The next click of the button finally centers it.

That is really strange behavior. I am not able to figure out eh properties to set to duplicate your behaviors.

What is the command you are using to open the form frmpwrk?

In the frmpwrk form's properties, is it set to Popup and/or Modal? What about Auto Center and Auto Resize?



FWIW: Since Office 2007 I have switch from the overlapping forms to the new tabbed documents style.
 
AutoCenter No, AutoResize Yes (I checked these settings with settings in your demo), and popup and modal both no. It is called with: DoCmd.OpenForm stDocName, , , stLinkCriteria.

What I have done with the many other forms in the application is to open a background form maximized followed by the main menu as a popup. The next forms, opened by buttons on the mainmenu are all centered popups, each stacked on top of previous. They are all set with none as the border style and their background colors are the same as the opening background, so opening one simply changes the visible fields and everything is centered and orderly, and they all work as they did as normal maximized forms except for this one form. I have gotten stubborn about getting this one to work! And yes, I routinely create a new db and import into it to keep it a bit cleaner.
 

Users who are viewing this thread

Back
Top Bottom