Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

access 2013 Set Size and location of a pop-up form

Posted on 2014-10-14
3
Medium Priority
?
781 Views
Last Modified: 2014-10-15
I have an access 2013 application where I have created a pop-up reference form that is opened when I get focus on a field and then closed when I lose focus - The form is a datasheet view and I would like to size the form and set its location - is there a way to do this?
0
Comment
Question by:rogerdjr
  • 2
3 Comments
 
LVL 49

Expert Comment

by:Dale Fye
ID: 40381351
In the forms Load event, use the move method to reposition and size the form, something like:

Private Sub Form_Load()

    Me.Move 3000, 3000, 7500, 5000
   
End Sub
0
 

Author Comment

by:rogerdjr
ID: 40381403
I created this code to run on the got focus event of a control in the working form, opening a "reference form"

    DoCmd.OpenForm "CASp_zLkupImplementationPlanPriorityListFrm", acFormDS
    DoCmd.MoveSize -10080, 6480, 4320, 2160


which partially addresses the issue - two things I want to correct but I'm not sure how to do it

1) Set position relative to the control that currently has focus rather than to the available screen area (that is set the top of the reference form 1" right and at the same vertical position as the control on the working form)
2) I don't want the cursor to jump to the pop-up its just ref info.

thanks
0
 
LVL 49

Accepted Solution

by:
Dale Fye earned 2000 total points
ID: 40381958
You can use the form WindowTop and WindowLeft properties to get the relative position of the top left corner of a form.  Then, within the form, you have determine the relative position of the particular control you are working with, so to get the bottom of your current control, you might use something like:

me.windowTop + me.Detail.Height + me.Controls("yourControl").top + me.controls("yourControl").height

And the right side of that control might be:

me.WindowLeft + me.Controls("yourControl").Left + me.Controls("yourControl").width
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question