Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Text Animate (A2000)

    Don't know if this is possible but here goes.

    On a form which has several controls or texts, I would like if possible, when a control has the focus, move it to the right let's say 5cm.

    Has anyone ever dabbled with this, and how can it be done ?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Text Animate (A2000)

    It can be done, but don't you think that the user would get rather irritated and/or nervous when controls keep jumping about the screen?

    If you want to try it, use code like this - replace txtName by the name of your control. Properties such as Left, Top, Width and Height are measured in VBA in twips - there are 1440 twips in an inch / 567 twips in a cm.

    Private Sub txtName_GotFocus()
    ' Left side 3 inches from left border
    txtName.Left = 3 * 1440
    Me.Repaint
    End Sub

    Private Sub txtName_LostFocus()
    ' Left side 1 inch from left border
    txtName.Left = 1440
    Me.Repaint
    End Sub

  3. #3
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Text Animate (A2000)

    Hans
    I had to chuckle with your first couple of lines, I can imagine quite a few sparks and keyboards being thrown out of the window here !!!

    Your code works fine.

    I'm messing with the switchboard, trying to make it look not so drab.
    I thought having focus with each menu selection and moving it by 1.1 * 1440 would look quite snazzy.

    How about different colours.

    My texts are currently the bright orange from the forms colour selector. I can change the texts to :

    Me.OptionLabel1.BackColor=VBblue

    But How ? to revert back to the orange when the focus has been lost ??

    Is there such a thing as VBorange ??

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Text Animate (A2000)

    Dave,

    There is no built-in constant vbOrange, but you can define it yourself in a module. When you set the background colour to orange manually, you can check what the resulting BackColor property is. Copy that value to the clipboard (or write it down). Then, switch to the Visual Basic Editor and create a new standard module. Type

    Public Const vbOrange = 33023

    Use the value you copied or wrote down instead of 33023. Now, you can use vbOrange in all your code in this database. Of course, you could also use the literal value, but a symbolic constant makes your code more readable.

    Side note: in the courtesy car planner form you were working on two months ago, I used this to define colour constants for dark red, green and blue:
    ' Colors for month bar
    Const vbDarkRed As Long = &H80
    Const vbDarkGreen As Long = &H8000&
    Const vbDarkBlue As Long = &H800000

  5. #5
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Text Animate (A2000)

    Thanks Hans.
    Perfect <img src=/S/thankyou.gif border=0 alt=thankyou width=40 height=15>

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Text Animate (A2000)

    Note to Access 97 users: the code I posted to move a control on the fly when it gets or loses focus doesn't work completely as it should in Access 97 (SR2). When the control gets focus, it seems to get moved OK, but the input cursor and the edit area are still in the old position... The problem doesn't occur in Access 2002.

    Since I am not in favour of using this method anyway, I am not going to try to find a solution or workaround for this in Access 97.

  7. #7
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Text Animate (A2000)

    Dave,

    Bright orange, or any bright color, becomes very tiring to look at. On some monitors it can actually be painfully bright. Trying to make an application "snazzy" can lead you into a whole series of interface design no-nos that do nothing to really improve the look of the application. I find a lot of color intensely irritating and generally refuse to use anything too "colorful".
    Charlotte

  8. #8
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Text Animate (A2000)

    Charlotte
    My feelings are the same, I hate too see input forms in any kind of bright colour, Although, I use a couple within my db.

    I like information forms in Mauve / Blue, Detail forms such as Insurer info and input forms in traditional grey and white.

    The purpose behind my strange requests today are for menu purposes only.

    I've attached a snippet to give you an idea on what I am doing here.
    The code behind the controls I would really like to reduce so as not to be repetitive, but, I can live with it for now.

    Feedback and comments are extremely welcome.

    Other than that, I'm just going thru a mad phase.
    Attached Files Attached Files

  9. #9
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Text Animate (A2000)

    Ok , I agree, told you I was having a mad day.

    I'll go back to the drawing board.

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Text Animate (A2000)

    Hi Dave,

    I hope things are a bit calmer now. I have attached a modified version of your switchboard form. The OnGotFocus/OnLostFocus events of the buttons are all handled by two functions now, analogously to the way the HandleButtonClick function handles the OnClick events.

    The code handles more than 15 options in a switchboard correctly - in your version, all buttons would be moved to the left (at 1 inch). To test it, I added two dummy items to the maintenance switchboard.

    I made a few other modifications to the existing switchboard code, but they're not essential.
    Attached Files Attached Files

  11. #11
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Text Animate (A2000)

    Hans
    Yes, I'm a bit calmer today, thanks for the concern. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    Your code works fine and hats off to you for the extended effort in regulating the code for me.

    I've totally re-vamped the form, but am still playing with idea's.

    I used the Switchboard Manager a couple of years ago but didn't realise the potential it has, I'm glad you suggested it to me.

    Have a good day.

  12. #12
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Text Animate (A2000)

    I'm just wondering if its possible to password certain area's without using Access Security. !!

  13. #13
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Text Animate (A2000)

    It depends on how secure you want to be. It is perfectly possible to prevent users from accessing certain forms, reports etc. by accident. But if you want to protect the data in your tables, user-level security is the only way. As long as your database is unsecured that way, anyone can create links to your tables, giving unlimited access to the data.

  14. #14
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Text Animate (A2000)

    Didn't we have this discussion early on in other threads, Dave? Trust me, protecting parts of you application is far easier with Access security than by reinventing that wheel for yourself.
    Charlotte

  15. #15
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Text Animate (A2000)

    Charlotte
    Yes we did discuss this earlier, I'm just a little dubious in pushing myself forward and attempting to implement the security settings.

    If I copy my db and paste, will security settings affect any other db's on the machine ?

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •