473,414 Members | 1,703 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

How to Maximize One Form And Not Others?

124 100+
Upon opening my application I want my form f_Main to open maximized. I know that can simply be done by DoCmd.Maximize. However, as we all know, maximizing one form causes the rest to be maximized, which I don't want. In fact, the only form I want maximized at all times is f_Main. If I put DoCmd.Restore in a child window, it restores that window but it also restores the f_Main form, which I don't want.

I understand that if I make all other child windows Pop Ups that'll work but I can't do that because, for some very strange reason, if you set a form to be Pop Up you can't delete any records from that form. Instead, what you end up deleting is a record on the parent window (and thus the parent record instead of a child record). Therefore, setting the Pop Up property = True will not work for me. With all this in mind is there a way for me to accomplish what I want?
Aug 19 '10 #1
8 6940
Delerna
1,134 Expert 1GB
In answer to your question, not that I am aware of.

That is interresting about the popup/delete problem. I have never tried myself so I cannot comment on the accuracy of that statement.
If indeed it is true, then setting the forms popup property can still work for you if you take control of the database operations with VBA instead. I know that requires more work from you but when you reallywant an effect that cannot be achieved through standard functionality, that is what you have to do.


Unless there is a way that I do not know of.
As far as access is concerned, everything is maximized or everything is not maximized.
You could programmatically set the size of each form I suppose but then you need to find out the resolution each users monitor is set to.
Aug 20 '10 #2
missinglinq
3,532 Expert 2GB
Setting a form to Popup or Popup/Modal does not, in and of itself, prevent records from being deleted! You have to have something else going on here that is doing this.

Linq ;0)>
Aug 27 '10 #3
bullfrog83
124 100+
If that's true, then I wish I knew what the problem is! If I set it to Modal only then I'm alright. But if I set the PopUp property = True then I have the problem. There's another post (albeit old) on bytes where someone else encountered the same problem and had to create a delete button next to each record to solve it. I think that's superfluous. The thread is titled "Delete record on popup-subform impossible?"
Aug 27 '10 #4
NeoPa
32,556 Expert Mod 16PB
You could use the following code, but this makes no allowance for the stuff that isn't required around the edges when a form is maximised. I expect you can sort that out with a little playing around.
Expand|Select|Wrap|Line Numbers
  1.     Dim lngWH As Long, lngWL As Long, lngWT As Long, lngWW As Long
  2.  
  3.     With Me
  4.         DoCmd.Maximize
  5.         lngWT = .WindowTop
  6.         lngWL = .WindowLeft
  7.         lngWH = .WindowHeight
  8.         lngWW = .WindowWidth
  9.         DoCmd.Restore
  10.         Call .Move(lngWL, lngWT, lngWW, lngWH)
  11.     End With
Aug 27 '10 #5
reginaldmerritt
201 100+
That is a really nifty bit of code NeoPa.

Any way of making it a public sub routine?

tried using the following but came up with an error
Can't find the form " refered

Expand|Select|Wrap|Line Numbers
  1. Public Sub FullScreen(ByVal strCurrentForm As String)
  2. Dim lngWH As Long, lngWL As Long, lngWT As Long, lngWW As Long
  3. With Forms(strCurrentForm)
  4.     DoCmd.Maximize
  5.     lngWT = .WindowTop
  6.     lngWL = .WindowLeft
  7.     lngWH = .WindowHeight
  8.     lngWW = .WindowWidth
  9.     DoCmd.Restore
  10.     Call .Move(lngWL, lngWT, lngWW, lngWH)
  11. End With
  12. End Sub
  13.  
I called the sub using:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2. FullScreen (FRMStaffList)
  3. End Sub
  4.  
Am I way of track here?
Sep 3 '10 #6
MikeTheBike
639 Expert 512MB
Hi

As you say pretty nifty code from NeoPa.

I would suggest your load event should be
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.     FullScreen Me.Name
  3. End Sub
??

MTB
Sep 3 '10 #7
reginaldmerritt
201 100+
Thanks MTB. Great shout, works perfectly. ;)
Sep 4 '10 #8
NeoPa
32,556 Expert Mod 16PB
Sorry guys. been away for a week, but it seems Mike had you covered anyway. In that context that's exactly the way to call the procedure.

In response to your earlier question about making it more publicly accessible, that would require defining the procedure code (that you pretty well have perfect) in a standard module as opposed to within the module of a form (I'm just guessing this is what you have done from the question).

The only other point I would make is that you have the option of defining the passed parameter as a Form object instead of a string. That way you would pass the form itself, rather than the name. This may or may not suit your needs better (depending on other potential usages), but would mean you could simplify the With line, as well as the call to the procedure.
Sep 6 '10 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Brandon | last post by:
Hello there. I'm currently working on a moderately complex Visual C# windows application that I have run into a bit of a problem on. To start things off, the application has normally been run...
2
by: Mark | last post by:
If my application gets minimized, how can I maximize it again? Mark
2
by: Jerome Ranch | last post by:
Okay What property of a form do I need to change so that it opens full screen? I'm calling it to open from VBA. I built a form today, and while I was playing with it (to test some of the...
13
by: John | last post by:
Hi, I have on form MenuBar, Toolbar, and Grid control. Form property is set to form opens as Maximized. Form maximizes through whole screen, but I don't see bottom part of grid, because...
5
by: Mrozu | last post by:
Hi When I maximize a form in VB.Net 2003 the bottom of the form gets hidden by the start bar (so my status bar is invisible). How can I get my app to maximize to the usable screen area above...
0
by: NiTiN | last post by:
Hi! I'm creating a Windows Application project and am using forms to add to a panel (instead of controls or MDI). I seem to have a problem with getting the forms to maximize, thus my anchor...
2
by: Kevin | last post by:
Does anyone know a simple way to have a program start with the main form maximized on Display2?
2
by: hawaiijeff | last post by:
I thought I solved this problem before, but apparently not. I have a form called main_menu which contains a whole bunch of buttons to access other forms. One of those buttons simply opens a table...
2
by: =?Utf-8?B?S2F5xLFoYW4=?= | last post by:
i have a datagridview on my Form. When i maximize form ,datagridview remains in its initial size. i want it rearrage itself with parent form. is it possible to solve on v.studio design mode ...
6
by: MarwaAlSagheer | last post by:
hi How can we run the app on full-screen. I mean all the controls such as, pictureboxe, button on the form would also be re-located when run application at maximize window state Currently, when...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.