Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10

    Unanswered: Custom right-click menus w/out API

    Here's a question for you to ponder over the weekend...
    Is it possible to create custom right click menus for forms/controls without an API call?
    If so, how?
    George
    George
    Home | Blog

  2. #2
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Hey George,


    In the Form Detail, Add this code:
    Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = 2 Then
    DoCmd.OpenForm "MyPopUpMenu"
    End If

    End Sub

    Where MyPopUpMenu is the PopUp form with your menu items. You may need to set the Shortcut Menu properties to No.

    (hope that's what you were looking for. There's also a sample in the code-bank of the code above.)
    Last edited by pkstormy; 06-01-07 at 14:41.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  3. #3
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by georgev
    Here's a question for you to ponder over the weekend...
    Is it possible to create custom right click menus for forms/controls without an API call?
    Yes.
    Quote Originally Posted by georgev
    If so, how?
    George
    That is for you to ponder over the weekend
    Attached Files Attached Files
    Last edited by pootle flump; 06-02-07 at 12:46. Reason: Added some fivolity to annoy grumpy pants
    Testimonial:
    pootle flump
    ur codings are working excelent.

  4. #4
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Wow! I like that a lot better (even though you cheated and used API.) The "Hello George" plastered all over my screen was cool and intuitive - but obviously I changed what I downloaded to my name. Nice code. You gonna post that in the Code Bank Pootle? (I think the code bank could use more snippets.)
    Last edited by pkstormy; 06-02-07 at 15:57.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  5. #5
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by pkstormy
    you cheated and used API.
    yes but I did not violate George's requirement - the API was for the fun bit only - it was not used for the left click menu part.

    Quote Originally Posted by pkstormy
    You gonna post that in the Code Bank Pootle? (I think the code bank could use more snippets.)
    It could - maybe. I am toying with posting a few thoroughly useless snippets into the bank (I have a nice one that animates the office help characters for example.) We'll see
    Testimonial:
    pootle flump
    ur codings are working excelent.

  6. #6
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    I'd really like to see the animating office help one!
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  7. #7
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Quote Originally Posted by pootle flump
    That is for you to ponder over the weekend
    If I had the internet at home over the weekend I would have
    That's really nice - I like the added smiley!

    I will hopefully find some time to play with it today and drop some feedback! Thanks for this Poots.

    Oh and useless code snippets are awesome bank as many of them as possible! I have my practice database (aptly named db1.mdb) that has about 50 forms - each of which does a couple of stupid functions, pure class
    George
    Home | Blog

  8. #8
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    I just noticed that Paul and Poots' orange is different; why is that?
    I know you're expecting this Poots - but where the heck is the right click menu programmed? There's no event - which leads me to think it is an in built Access thing?
    George
    Home | Blog

  9. #9
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by georgev
    I just noticed that Paul and Poots' orange is different; why is that?
    Hadn't noticed that. To give me my full title I am actually a "Super Moderator" I guess Paul is a lowly, boot cleaning "Moderator" serving his apprenticeship.

    There is a page somewhere that shows this sort of stuff. I'll see if I can find....

    Quote Originally Posted by georgev
    I know you're expecting this Poots - but where the heck is the right click menu programmed? There's no event - which leads me to think it is an in built Access thing?
    Your thoughts lead you down the correct path padwan. HINT - check the form properties.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  10. #10
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    I went over them before but somehow missed the one with my name
    Short Cut Menu bars eh...
    I have one ever so slight problem View > Toolbars > *nothing* I can't get to the customize menu on this database - how odd!
    I have managed to find out how to access it though - just interested in your method of customization. I noted the Popup property and "allow customizations" but I'm not entirely sure how you added any commands to it
    I will run off to google later today and search the crap out of custom shortcut menus

    Thank you
    George
    Home | Blog

  11. #11
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Try Tools -> Customise.

    I have noticed in the past that piddling with the menus can screw other things up. What you mention, and a few other things, are in evidence here. The best way I found round it was to create all custom menus in a dedicated app. When ready, backup the master application and import. I didn't bother in this case.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  12. #12
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    I did that
    But yeah - "george" is not on the list - you have to hit the "properties" button and select it in there - but you can't customize it that way.
    What version of Access was this made in - I'm on 2003.
    This custom menu lark is pretty flaky
    George
    Home | Blog

  13. #13
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Testimonial:
    pootle flump
    ur codings are working excelent.

  14. #14
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by georgev
    But yeah - "george" is not on the list - you have to hit the "properties" button and select it in there
    No you don't - tick the Shortcut Menus option and play around with the bar that apears.

    2003.

    And yes - IME they are a tad flakey hence the dedicated application.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  15. #15
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Quote Originally Posted by pootle flump
    Psst - wrong thread

    And I didn't notice that - thank you
    I love the fact you can even add an image!

    I will certainly expand on the possibility of custom right click menus in my next project / when I have some spare "play-time"
    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
  •