I’m sorry to bother you busy folks with what is just a matter of curiosity, but IT”S KILLING ME! My instructor offered extra credit for writing code that would cause the textboxes (with their labels) to “float” across the form from right to left for 10 iterations. I get the LOOP thing. That wasn’t any problem. I couldn’t find anything to give me a clue about making a textbox “float”. The assignment is turned in. I should be able to forget it, right? Well I can’t. Could someone ease my pain?
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Floating Fields (2002)
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Floating Fields (2002)
- This topic has 14 replies, 3 voices, and was last updated 20 years, 11 months ago.
AuthorTopicWSladygnome
AskWoody LoungerJune 14, 2004 at 8:42 pm #406172Viewing 3 reply threadsAuthorReplies-
WSDrew
AskWoody Lounger -
WSladygnome
AskWoody Lounger -
WSHansV
AskWoody LoungerJune 16, 2004 at 2:35 pm #841060Each control has Left and Top properties that determine its position, and Width and Height properties that determine its size. In Visual Basic, they are measured in twips, where 1 inch = 1440 twips. So to position a text box txtSomething one inch from the left side of the form, use
Me.txtSomething.Left = 1440
Or to move it 1/2 inch to the right from its current position:
Me.txtSomething.Left = Me.txtSomething.Left + 720
-
WSHansV
AskWoody LoungerJune 16, 2004 at 2:35 pm #841061Each control has Left and Top properties that determine its position, and Width and Height properties that determine its size. In Visual Basic, they are measured in twips, where 1 inch = 1440 twips. So to position a text box txtSomething one inch from the left side of the form, use
Me.txtSomething.Left = 1440
Or to move it 1/2 inch to the right from its current position:
Me.txtSomething.Left = Me.txtSomething.Left + 720
-
WSladygnome
AskWoody Lounger -
WSladygnome
AskWoody Lounger
-
-
-
WSDrew
AskWoody LoungerJune 16, 2004 at 4:47 pm #841146Actually, I am truly a Dallasite now. I used to live in Mckinney, but I moved into Dallas back in April. LONG story.
As to your post, let me try to explain in a more ‘intuitive’ way. VB/VBA is supposed to be an object oriented programming language. This is a touchy subject, because C programmers will harp on the fact that VB does not have inheritence. (VB.Net does, but VB 6.0, and VBA (which is a subset of VB, sort of…VB is also a subset of VBA) doesn’t). Anyhow, there are two types of code within VB/VBA. Objects and Processes. An object has attributes, a process has an outcome. Take for example a form. A form has attributes, such as height, width, background color, etc. A process just has an outcome, like UCase. UCase turns a string into all Caps.
Now, it gets a bit more complicated then that, but processes and objects are the basics. Processes can deal with objects, and objects can have processes. In this particular case, you want to use an objects properties, to create a process, the Left property, to cause the control to ‘float’. Now, we could just do something like this:
Sub Float()
Dim i As Long
For i = 1 To 10
Do Until Me.txtFloat.Left + Me.txtFloat.Width = Me.Width
Me.txtFloat.Left = Me.txtFloat.Left + 1
Screen.ActiveForm.Repaint
Loop
Do Until Me.txtFloat.Left = 0
Me.txtFloat.Left = Me.txtFloat.Left – 1
Screen.ActiveForm.Repaint
Loop
Next i
End SubThis ‘floats’ a control called txtFloat, from right to left, ten times. This is a process, that changes an object’s attributes. However, it is only doing one control. If you really want to build something to affect all textboxes, let me know, just don’t want to make a 5 page post!
-
WSladygnome
AskWoody LoungerJune 17, 2004 at 6:57 pm #841772(Edited by charlotte on 17-Jun-04 12:57. Rule #10)
Ah ha! The light comes on. Looking back, I can now see where it is in the book. It doesn’t give you this, it just talks about pixels and – twixes?? I suppose all the information was there if I were brighter. Now — even though the credit is no longer on the table, I would still like to incorporate this in my final project, which my instructor has deemed ” a little strange, but well thought out.” All he asks for is that all the data in the tables be exported and the database shut down after 2 or 3 erroneous login attempts. I’m getting there.
I really would like to have the textboxes “float away” before the database closes. Just to show him I kept trying. I’m also going to attempt to have it turn bright red and beep.Just because I am a little strange.
I would also like to hear the long story about how you wound up in Dallas.
Thanks Drew
-
WSladygnome
AskWoody LoungerJune 17, 2004 at 6:57 pm #841773(Edited by charlotte on 17-Jun-04 12:57. Rule #10)
Ah ha! The light comes on. Looking back, I can now see where it is in the book. It doesn’t give you this, it just talks about pixels and – twixes?? I suppose all the information was there if I were brighter. Now — even though the credit is no longer on the table, I would still like to incorporate this in my final project, which my instructor has deemed ” a little strange, but well thought out.” All he asks for is that all the data in the tables be exported and the database shut down after 2 or 3 erroneous login attempts. I’m getting there.
I really would like to have the textboxes “float away” before the database closes. Just to show him I kept trying. I’m also going to attempt to have it turn bright red and beep.Just because I am a little strange.
I would also like to hear the long story about how you wound up in Dallas.
Thanks Drew
-
-
-
WSDrew
AskWoody LoungerJune 16, 2004 at 4:47 pm #841147Actually, I am truly a Dallasite now. I used to live in Mckinney, but I moved into Dallas back in April. LONG story.
As to your post, let me try to explain in a more ‘intuitive’ way. VB/VBA is supposed to be an object oriented programming language. This is a touchy subject, because C programmers will harp on the fact that VB does not have inheritence. (VB.Net does, but VB 6.0, and VBA (which is a subset of VB, sort of…VB is also a subset of VBA) doesn’t). Anyhow, there are two types of code within VB/VBA. Objects and Processes. An object has attributes, a process has an outcome. Take for example a form. A form has attributes, such as height, width, background color, etc. A process just has an outcome, like UCase. UCase turns a string into all Caps.
Now, it gets a bit more complicated then that, but processes and objects are the basics. Processes can deal with objects, and objects can have processes. In this particular case, you want to use an objects properties, to create a process, the Left property, to cause the control to ‘float’. Now, we could just do something like this:
Sub Float()
Dim i As Long
For i = 1 To 10
Do Until Me.txtFloat.Left + Me.txtFloat.Width = Me.Width
Me.txtFloat.Left = Me.txtFloat.Left + 1
Screen.ActiveForm.Repaint
Loop
Do Until Me.txtFloat.Left = 0
Me.txtFloat.Left = Me.txtFloat.Left – 1
Screen.ActiveForm.Repaint
Loop
Next i
End SubThis ‘floats’ a control called txtFloat, from right to left, ten times. This is a process, that changes an object’s attributes. However, it is only doing one control. If you really want to build something to affect all textboxes, let me know, just don’t want to make a 5 page post!
WSladygnome
AskWoody LoungerWSDrew
AskWoody LoungerWSDrew
AskWoody LoungerJune 22, 2004 at 9:35 pm #843675Just so we don’t leave everyone in the dark, I am posting a ‘flashy’ method of closing a form, and even closing Access. This is what LadyGnome is going to use instead of ‘floating’ the controls. There are three forms. The ‘twist out’ form doesn’t really twist, I would have to use transformations to do that, and just don’t have time to mess around with that right now.
The modules in this db are completely standalone, so you can import them into any project you want. Use the code behind the buttons on the sample forms to see how it works. (The functions only require the forms hWnd value).
Enjoy!
WSDrew
AskWoody LoungerJune 22, 2004 at 9:35 pm #843676Just so we don’t leave everyone in the dark, I am posting a ‘flashy’ method of closing a form, and even closing Access. This is what LadyGnome is going to use instead of ‘floating’ the controls. There are three forms. The ‘twist out’ form doesn’t really twist, I would have to use transformations to do that, and just don’t have time to mess around with that right now.
The modules in this db are completely standalone, so you can import them into any project you want. Use the code behind the buttons on the sample forms to see how it works. (The functions only require the forms hWnd value).
Enjoy!
Viewing 3 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Discover the Best AI Tools for Everything
by
Alex5723
3 hours, 41 minutes ago -
Edge Seems To Be Gaining Weight
by
bbearren
6 hours ago -
Rufus is available from the MSFT Store
by
PL1
14 hours, 39 minutes ago -
Microsoft : Ending USB-C® Port Confusion
by
Alex5723
16 hours, 49 minutes ago -
KB5061768 update for Intel vPro processor
by
drmark
2 hours, 42 minutes ago -
Outlook 365 classic has exhausted all shared resources
by
drmark
15 hours ago -
My Simple Word 2010 Macro Is Not Working
by
mbennett555
12 hours, 34 minutes ago -
Office gets current release
by
Susan Bradley
15 hours, 11 minutes ago -
FBI: Still Using One of These Old Routers? It’s Vulnerable to Hackers
by
Alex5723
2 days, 5 hours ago -
Windows AI Local Only no NPU required!
by
RetiredGeek
1 day, 13 hours ago -
Stop the OneDrive defaults
by
CWBillow
2 days, 6 hours ago -
Windows 11 Insider Preview build 27868 released to Canary
by
joep517
2 days, 16 hours ago -
X Suspends Encrypted DMs
by
Alex5723
2 days, 18 hours ago -
WSJ : My Robot and Me AI generated movie
by
Alex5723
2 days, 18 hours ago -
Botnet hacks 9,000+ ASUS routers to add persistent SSH backdoor
by
Alex5723
2 days, 19 hours ago -
OpenAI model sabotages shutdown code
by
Cybertooth
2 days, 19 hours ago -
Backup and access old e-mails after company e-mail address is terminated
by
M W Leijendekker
2 days, 7 hours ago -
Enabling Secureboot
by
ITguy
2 days, 14 hours ago -
Windows hosting exposes additional bugs
by
Susan Bradley
3 days, 3 hours ago -
No more rounded corners??
by
CWBillow
2 days, 23 hours ago -
Android 15 and IPV6
by
Win7and10
2 days, 13 hours ago -
KB5058405 might fail to install with recovery error 0xc0000098 in ACPI.sys
by
Susan Bradley
3 days, 15 hours ago -
T-Mobile’s T-Life App has a “Screen Recording Tool” Turned on
by
Alex5723
3 days, 18 hours ago -
Windows 11 Insider Preview Build 26100.4202 (24H2) released to Release Preview
by
joep517
3 days, 13 hours ago -
Windows Update orchestration platform to update all software
by
Alex5723
4 days, 2 hours ago -
May preview updates
by
Susan Bradley
3 days, 13 hours ago -
Microsoft releases KB5061977 Windows 11 24H2, Server 2025 emergency out of band
by
Alex5723
3 days, 4 hours ago -
Just got this pop-up page while browsing
by
Alex5723
3 days, 18 hours ago -
KB5058379 / KB 5061768 Failures
by
crown
3 days, 15 hours ago -
Windows 10 23H2 Good to Update to ?
by
jkitc
2 days, 17 hours ago
Recent blog posts
Key Links
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.