Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to change position of a "Line" control based on user selection in

Status
Not open for further replies.

TransactSQL

Technical User
Feb 24, 2006
3
US
Hi,



I have a form with a combo box and a "line" control. Combo box has 5 selections such as 1,2,3,4,5. When user selects one of 5 selections, Line control should change it's position. For example, if user selects 1, line control should move to 1" lower or if user selects 3, line control should move to 3" lower and so on. I've been trying to do this for last few days but can't make it to work. Can anyone please help me? Thank you so much!! Really appreciate it.

 
1" lower than what? Can you share the code you used? A guess is:
Code:
' after update event of the un-named combo box
Dim intOriginalPosition as Integer
intOriginalPosition  = 1000 '?
Me.linNoNameGiven.Top = Me.cboNoNameGive * 1440 + intOriginalPosition

Duane
Hook'D on Access
MS Access MVP
 
Hi Duane,

Thanks a lot for your quick response. I applied the following code and it's working now:

'Me.Line71.Top = 1440 + ComboBoxValue"
Me.Line71.Top = Me.Line71.Top - 15
Me.Line71.Width = Me.Line71.Width + 165
Me.Line71.Height = Me.Line71.Height + 345

Just realized that "1440" is equivalent to 1" (1 Inch). So I need to figure out what would be the equivalent to .5 milimeter because I have to move the TOP to .5 milimeter each time user select diff selection form the combobox. Let me know if you know what's the measurament for .5 milimeter. Otherwise, i will figure it out i think. still appreciate your response. Now I know hot to change top, left, height, width. A big help!!

Thanks.

 
You should be able to figure out the conversion in the same way that I would... google the conversion factor.

I'm not sure how your combo box figures into your code but assume you have this worked out.

Duane
Hook'D on Access
MS Access MVP
 
How are ya TransactSQL . . .

twips = (mm * 1440)/25.4
= (.5 * 1440)/25.4
= 28.346456692913385826771653543307
Code:
[blue]   Me.Line71.Top = ((.5 * 1440)/25.4) + (1440 * Me!ComboboxName)[/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Thanks a lot TheAceMan1 & Duane!..you guys are awesome. I got what i was looking for. Really appreciate it!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top