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

Text box Position on form

I'd like to change the top margin of a text box based on a State Field.

So if the state is LA I want the box to appear 1" from the top, if it's
CA I want it to appear 2" from the top.

If State = "LA" Then
lablename.Move
Top:=1
End If
Nov 13 '05 #1
3 2282
On 15 Sep 2004 07:56:08 -0700, mar10a wrote:
I'd like to change the top margin of a text box based on a State Field.

So if the state is LA I want the box to appear 1" from the top, if it's
CA I want it to appear 2" from the top.

If State = "LA" Then
lablename.Move
Top:=1
End If


In the Form's Current event and in the State control's AfterUpdate
event:
If Me![State] = "LA" then
Me![ControlName].Top = 1 * 1440
ElseIf Me![State] = "CA" Then
Me![ControlName].Top = 2 * 1440
Else
Me![ControlName].Top = ? * 1440
End If

All measurements are in Twips, 1440 per inch.

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 13 '05 #2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

How's about:

dim intTop as integer
select case State
case "LA": intTop = 1
case "CA": intTop = 2
end select
Me!text_box_name.Top = intTop

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQUhsEIechKqOuFEgEQKdjACgrVlzDDsU1ONUyaFwMTl9qY dYaDQAn16w
rcj46WbhrR5ARxQI0l4cEw6U
=Oq4o
-----END PGP SIGNATURE-----
mar10a wrote:
I'd like to change the top margin of a text box based on a State Field.

So if the state is LA I want the box to appear 1" from the top, if it's
CA I want it to appear 2" from the top.

If State = "LA" Then
lablename.Move
Top:=1
End If


Nov 13 '05 #3
Try lablename.top = 1440

(I think 1440 = 1 inch. position messured in twips not inches)

mar10a wrote:
I'd like to change the top margin of a text box based on a State Field.

So if the state is LA I want the box to appear 1" from the top, if it's
CA I want it to appear 2" from the top.

If State = "LA" Then
lablename.Move
Top:=1
End If

Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: AP | last post by:
I am trying to find the integer value for the cursor position in a text box, in particular I want to find out if I am at the end of some text that I typed or at the beginning. I am using IE 6. ...
2
by: charlie_M | last post by:
I have the following code: <script type=text/javascript> function hide_tooltip(){ var hp = document.getElementById("tooltipper"); hp.style.left=0; hp.style.top=0; hp.style.width=1;...
2
by: george.leithead | last post by:
Hi all, I have a very strange problem! In following Web page (which is generated from a CMS System), the navigation to the left 'dissapears' when you roll the mouse over the links? It does not...
1
by: littlealex | last post by:
IE6 not displaying text correctly - IE 7 & Firefox 3 are fine! Need some help with this as fairly new to CSS! In IE6 the text for the following page doesn't display properly - rather than being...
7
by: poornesh K V | last post by:
This is the details: I have a Form : ProjectDetails This form is made up of a TabControl : maintabctrl1 (Say 10 pages) Each page has a subform : subForm1 This subForm1 has tabcontrol :...
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:
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.