473,396 Members | 2,140 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,396 software developers and data experts.

Moving Control In VBA

31
Hi All.

I have a report that has a lot of different controls on it and only some need to be seen for certain customers.

I am trying to Move one control based on the position of the one next to it

Below is my code, but when the debugger pops up it highlights: Me.CustSKU.Left = Me.CXL.Right + 25



Expand|Select|Wrap|Line Numbers
  1. Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
  2.  
  3. Dim lngCustID As Long
  4.  
  5. lngCustID = Forms![AllCust]![Customer]
  6.  
  7. Select Case lngCustID
  8.     Case 'Customer ID
  9.         Me.CustSKU.Visible = True
  10.         Me.CustSKU_Label.Visible = True
  11.         Me.CustSKU_Label.Left = Me.CustSKU.Left
  12.         Me.CustSKU_Label.Width = Me.CustSKU.Width
  13. ...
  14.         Me.CustSKU.Left = Me.CXL.Right + 25
  15.         Me.Field1.Left = Me.CustSKU.Right + 75
  16.         Me.Field2.Left = Me.Field1.Right + 75
  17.         Me.Field3.Left = Me.Field2.Right + 75
  18.         Me.Field4.Left = Me.Field3.Right + 75
  19.         Me.Field5.Left = Me.Field4.Right + 75
  20. ...
  21. End Select
  22. End Sub
Any suggestions would be appreciated.
Oct 13 '10 #1

✓ answered by gnawoncents

I could be wrong, but I don't think there is a ".right" in VBA. Instead try:

Expand|Select|Wrap|Line Numbers
  1. Me.CustSKU.Left = Me.CXL.Left + me.CXL.Width + 25 

2 4592
gnawoncents
214 100+
I could be wrong, but I don't think there is a ".right" in VBA. Instead try:

Expand|Select|Wrap|Line Numbers
  1. Me.CustSKU.Left = Me.CXL.Left + me.CXL.Width + 25 
Oct 13 '10 #2
BarbQb
31
I knew it was going to be something very simple.
Thanks gnawoncents!
Oct 13 '10 #3

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

Similar topics

12
by: swingingming | last post by:
Hi, in the NorthWind sample database, when clicking on the next navigation button on the new order record with nothing on the subform (order details), we got an order with nothing ordered. How can...
0
by: Mark Nijhof | last post by:
Hello, I made a small app that has those nice moving panels like Visual Studio has. Now all goes fine until I open one of them that has a lot of child controls in it. Actually it has one...
3
by: Just Me | last post by:
If I move the mouse cursor over a control and stop moving I get a MouseHover event. If I then move the cursor while staying within the control and then stop moving I do not get another...
0
by: Shawn | last post by:
I have a label control that I use dragdrop to move around a form. Is there a way to keep the label within the boundaries of a main panel that is housing several other panels that the label can be...
2
by: Diogo Alves - Software Developer | last post by:
Greetings I would like to knowhow can I put a sliding panel... I've done this: if (panel1.Width < 300) { while (panel1.Width < 300) { panel1.Width = panel1.Width + 40;
0
by: xpnet | last post by:
Hi, I am using Mutliview control, and want to move a user control from one view to another view based on user selection. I can do this by placing a "Placeholder" control in each views. Based on...
3
by: SonOf27 | last post by:
Morning all. I was hoping somone would be able to help me with some VBA program that will allow me to move the whole Tab Control on an Access form at runtime. What I have is a form in Access 2000...
3
by: hitesh bhalkiya | last post by:
how to move label in the form any other control has position property which use for moving control in the form but label do not have this property what to do ?
1
GaryTexmo
by: GaryTexmo | last post by:
In my last insight, http://bytes.com/topic/c-sharp/insights/909141-object-scaling-varying-resolutions, I talked about scaling objects to a form's size so that it would always draw with the correct...
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.