Solved

Move/Position a control with code

Posted on 2004-04-13
4
399 Views
Last Modified: 2006-11-17
Almost all of the resolution on EE about movesize address moving or postioning forms but I need to move a subform to a new position. I can do it in the properties of the subform but not in code. Basically, when the subform is clicked, I want some data from the main form to be not visible and the subform move up and occupy it's place.

thanks,

howard
0
Comment
Question by:howcheat
4 Comments
 
LVL 23

Expert Comment

by:heer2351
ID: 10816256
I guess you are trying to move the subform from code behind the subform, in that case you have to use the parent property:

  Me.Parent![subForm_CONTROL_Name].Top = 100
  Me.Parent![subForm_CONTROL_Name].Left = 100
0
 
LVL 32

Assisted Solution

by:jadedata
jadedata earned 100 total points
ID: 10816278
Greetings howcheat!

  Your requirement for the action to take when the subform is "clicked" doesn't make sense completely.
  Are you simply copying data from the subform or are you re-arranging the controls on the MAIN form?
  If the subform is the active control you may NOT be able to move it until the control has lost focus.

regards
jack
0
 
LVL 54

Accepted Solution

by:
nico5038 earned 150 total points
ID: 10816297
Hmm, I always try to keep controls as "fixed" as possible as moding them makes the form "flickering" for the user.
Why not simply set the control's Visible property to "No" when you need to hide it ?

Nic;o)
0
 
LVL 11

Expert Comment

by:phileoca
ID: 10816417
<<<Why not simply set the control's Visible property to "No" when you need to hide it ?>>>
=) i love this method.  Great way to hide buttons for admin use only.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

705 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now