Results 1 to 10 of 10

Thread: form bound menu

  1. #1
    Join Date
    Aug 2004
    Posts
    36

    Unanswered: form bound menu

    Hi. I've worked with Paradox for umpteen years and am trying to rewrite a fairly large system in Access 2003.

    The Users are very used to the Paradox forms so I don't want to change anything I don't have to change. I currently have a form specific menu load for each form. The menus are simple but they allow for the user to print fairly complicated reports by only making a menu selection.

    Paradox has a Menu Action event for each form. I used the following code in one form:

    choice = eventInfo.menuChoice()
    switch
    case choice = "&Search" : action(DataSearch)
    case choice = "Sample Rpt.": samp2()
    case choice = "Newhires by Sample Date": Newhires()
    case choice = "Newhires by File Sent Date": Newhires2()
    case choice = "Newhires for highlighted case": Newhires3()

    case choice = "Status Rpt.": statusrpt2()
    case choice = "Change Printer": changeprnt()
    case choice = "\008&Quit": action(DataEndEdit) close()
    otherwise : message("No selection from menu.")
    endswitch

    The code after each ":" calls that event (Newhires(), etc.)

    It's wonderful to use since you can create fairly complicated stuff in the Events. But I can't find anything comparable in Access. I tried doing a AddMenu macro group but I got some sort of weird menu thing that wouldn't go away.

    I could just put buttons on the form but at this point, I would feel like Access won if I did that.

    Could someone just point me to an example of how to do this?

    Thanks.

  2. #2
    Join Date
    Aug 2006
    Posts
    559
    Are you trying to open a new record or form with this?

  3. #3
    Join Date
    Aug 2004
    Posts
    36
    No. Most of the menu selections are for reports. But I do some backflips first. Like, if they click the menu selection for the Sample Report, the Events code runs a query that gathers all of the Sample Dates and pops that up in a list. The User selects one of the dates and the code runs the report for that sample date.

  4. #4
    Join Date
    Aug 2006
    Posts
    559
    Well, I'd say zip an upload a sample of the Paradox db you have, but I don't have that on my machine. I don't know if you can import the Paradox db into Access though. Oh...A little research and you can import the tables, I don't know what else will go though. This program does it, shareware but should work to do the importing. Works with Paradox 5 files so you'll just have to resave the db at that level of Paradox and then it'll import to Access.

    http://www.download3000.com/download_19768.html

    I'll see if there's anything else I can find out to get your whole Paradox db to Access, retaining all or most of what you currently have.

  5. #5
    Join Date
    Aug 2006
    Posts
    559
    From reading this, it's a trial, it'll do everything (tables, forms, queries, reports, etc)

    http://www.spectralcore.com/fullconvert/index.php

  6. #6
    Join Date
    Aug 2004
    Posts
    36
    I appreciate your research but that's not quite what I'm looking for. Importing the Paradox tables was easy. The challenge has been recreating the forms using VBA instead of objectPal, the Paradox language.

    I'm just looking for the code needed to create your own menu when you open a form.

    In Paradox, this code, written in the Open Event, displays this menu rather than the default Paradox Form menu:

    rptpu.addtext("Status Rpt.")
    rptpu.addtext("Newhires by Sample Date")
    rptpu.addtext("Newhires by File Sent Date")
    rptpu.addtext("Newhires for highlighted case")
    rptpu.addtext("Sample Rpt.")
    rptpu.addSeparator()
    rptpu.addtext("Change Printer")
    frmpu.addtext("Adhoc Form")
    mainMenu.addText("&Search")
    mainMenu.addPopUp("&Reports", rptpu)
    mainMenu.addText("&Help")
    mainMenu.addText("\008&Quit")
    ; now display the menu
    mainMenu.show()

    When the user clicks on a menu item, that code that I listed in my first email runs the selected method.

    I'm thinking their may be something similar in VBA that would go in the Access "Load" form event, but I don't know what the commands are and I can't find anything in the Help files.

  7. #7
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    You can create a switchboard via the wizard in MSAccess (Tools -> Database Utilities -> Switchboard Manager), but personally, I'd create a Menu starting with a blank form and just add the buttons/choices. This though is the equivalent of your Paradox menu setup.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  8. #8
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    It all depends on how you define "menu"
    IF you mean a "file" menu then this can be achieved through "Tools > Customize..."
    More info on request
    George
    Home | Blog

  9. #9
    Join Date
    Aug 2004
    Posts
    36
    Quote Originally Posted by georgev
    It all depends on how you define "menu"
    IF you mean a "file" menu then this can be achieved through "Tools > Customize..."
    More info on request
    I tried that but it didn't open and close with the form. The cusomized menu stayed up when the form was closed.

    I guess I'll just go with the buttons. Thanks, all.

  10. #10
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    You may wish to look at this post:
    http://www.dbforums.com/showthread.php?t=1618905

    I believe you can create context sensitive menus in a similar fashion (property of a form perhaps?) much like in Poots' solution in the above thread
    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
  •