Results 1 to 10 of 10
  1. #1
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10

    Unanswered: Index of control

    Hopefullly this is another very simple george-being-silly questions

    I have two controls and for ease let's call them txtA and txtB; these controls overlap.
    I want to change which one is on top via VBA - (how) can this be achieved?

    -George
    George
    Home | Blog

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    A quick google suggests this is hard\ impossible. Perhaps you could access this using the (LOL) DoCmd object.

    Code:
     
    docmd.RunCommand acCmdBringToFront
    Have not even tested. Perhaps you need to set focus to the correct control first?
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    I came across that earlier but couldn't get it to work the way I wanted (for a start I want to bring txtA to the front on form load and you cannot assign focus on form load.)

    I have been playing with all sorts of properties with no luck so far - will keep playing
    Thanks for the suggestion "Poodle" *lol*
    George
    Home | Blog

  4. #4
    Join Date
    Apr 2003
    Posts
    59
    When you say they overlap, are they both visible all the time but one's on top and part of the other is seen?

  5. #5
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by georgev
    I came across that earlier but couldn't get it to work the way I wanted (for a start I want to bring txtA to the front on form load and you cannot assign focus on form load.)
    Any reason the Open event can't be used? Or your favourite event, the timer
    Testimonial:
    pootle flump
    ur codings are working excelent.

  6. #6
    Join Date
    Feb 2007
    Posts
    348
    katerpillar has a good question there. Since they "overlap" do you want to just make one visible and one not? or are you showing both just in an odd way?

  7. #7
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Similarly, if you do need them both visible but part of one hidden - could you play with the control widths?
    Testimonial:
    pootle flump
    ur codings are working excelent.

  8. #8
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    What katerpillar says is true - one is on top of the other at all times (in an odd way) - both visible. If I couldn't find a way to programmatically make one on top then I was going to end up playing with widths, but that's not my ideal

    I am using the On Load event to instaltialate my form and it's controls (it does some resizing etc based on context).

    It's not a big problem and there are alternatives (as mentioned) - it was a partly hypothetical question "(how) can it be done?"
    Quote Originally Posted by Poodle *lol*
    Or your favourite event, the timer
    My favourite event is On Dirty, if you must know
    George
    Home | Blog

  9. #9
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Georgev,

    I always like your questions because they always involve something different/out of the norm and make you think. This may not be what you want but my suggestion would be to create 2 forms (with of course the caption bar not showing), one with 1 control and the other form with the other control. Then just cycle which form you want on top of the other control/form. Or maybe it would even work with a subform. (Crud - I don't think that's what you need.)

    Could you also make the controls text boxes and somehow utilize the setfocus command to bring one to the front verses the other? (Nope - I don't think that will work.) I wonder if an option group would work somehow manipulating it. It does the overlapping part and you can set one option to the front verses another, but I don't think it's what your looking for either. Ok - I give up.
    Last edited by pkstormy; 06-07-07 at 21:32.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  10. #10
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    I did think it was a good question
    You may notice that a number of questions are either hypothetical or out of the norm - I prefer a challenge

    It's not normal to overlap controls so I didn't think there was an inbuilt something-or-other (property?) to do it - but you never know!

    In the end I pratted about with widths and it pretty much did the job I wanted.
    George
    Home | Blog

Posting Permissions

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