Results 1 to 13 of 13
  1. #1
    aspfun is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2010
    Posts
    10

    Open form at fixed position using VBA

    I am looking for VBA code to make a form opening at fixed position every time.
    Can someone help me?


    In VB6 or VB.NET, this is very easy but for Access no.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Maybe this will help: http://www.baldyweb.com/Bookmark.htm

  3. #3
    aspfun is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2010
    Posts
    10
    This is a different issue.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Maybe if you described your issue in more detail we could give more accurate suggestions.

  5. #5
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    When you say "opening at fixed position' are you referring to the actual position of the Form vis-à-vis the screen, as in 'upper/center of screen' or 'bottom/right side of screen?'

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  6. #6
    aspfun is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2010
    Posts
    10
    For example, center

  7. #7
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    aspfun,

    You are a person of few words. Could you please give us a 2 sentence description of exactly the issue you are trying to solve?
    We're trying to help, but you have to participate.

  8. #8
    aspfun is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2010
    Posts
    10
    Sorry about it.
    For example, to open a form, I want it stay in the center of screen and do not display full screen.
    Since property of form do not have this feature.
    I try to set "Auto Center = Yes" but have to resize form each time.
    I need a code to make all forms open at fixed size: Width =80% width of screen, Height=70% of height of screen and stay at center of screen.

  9. #9
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726

  10. #10
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    If any form displays full screen then *all* forms will display full screen since it is a system wide variable. Are you still using ac2003?

  11. #11
    aspfun is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2010
    Posts
    10
    yes, ac2003

  12. #12
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Forms should remain the size and location where you put them while in Design mode if you save the form. Do any of your other forms put the form in FullScreen mode? (DoCmd.Maximize)

  13. #13
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    AutoCenter only centers Horizontally, and actually interferes if you try to manually position a Form, which is the only reliable way to center a Form, on both axies, that I’ve found, without using MoveSize. I tried MoveSize in the past, but found it to be more trouble than it was worth; of course, that’s just me! This method has worked for me for years:

    1. Set AutoCenter to No
    2. Set AutoResize to No
    3. Size and Move the Form to desired position
    4. Click on Save
    5. Close Form without doing anything else!

    You might have to tweak this a little, by repeating Steps 1-5, to get it to the exact, desired position.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Open form as dialog box and in specified position
    By Fredrik831 in forum Programming
    Replies: 3
    Last Post: 11-30-2012, 08:28 AM
  2. Replies: 8
    Last Post: 05-10-2012, 10:57 AM
  3. Position text boxes on form
    By Mclaren in forum Forms
    Replies: 4
    Last Post: 05-10-2011, 12:24 PM
  4. Set Form Position
    By Yance in forum Programming
    Replies: 3
    Last Post: 11-29-2010, 02:20 PM
  5. Report like a fixed form
    By mikr in forum Reports
    Replies: 0
    Last Post: 08-30-2009, 12:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums