Results 1 to 9 of 9
  1. #1
    dgaletar is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2013
    Location
    Washington, DC
    Posts
    85

    Question Create my own type of menu system from scratch in access

    Hello. I have been working on this for a while, and I have finally gotten to a point where I THINK that I finally know what to ask.



    I think that what I am trying to do is to create my own menu system instead of using the "Switchboard" option in Access.

    You see, I have a form named "View Reports". In its operational view it looks like this:
    Click image for larger version. 

Name:	ViewReports1.png 
Views:	15 
Size:	20.4 KB 
ID:	16471

    …and, in its ‘design view’ view, looks like this:
    Click image for larger version. 

Name:	ViewReports2.png 
Views:	15 
Size:	23.2 KB 
ID:	16472
    (basically, a title/header, an “unbound” object and 2 buttons)

    The “Form” itself uses a query as its control source. The query looks like this:
    Click image for larger version. 

Name:	ViewReports3.png 
Views:	15 
Size:	13.5 KB 
ID:	16473
    (pretty basic)

    And here is where I am stuck. What I am trying to make happen is this:
    · If you select the first option, “View Filter Types”, and then click on the “Open Report” button, it will open a similar form that lists the filter types (ie. “Oil Filters”, “Air Filters”, Fuel Filters”, etc.).
    · If you select the second option, “View Batteries Used”, and then click on the “Open Report” button, it will open the actual report “Batteries Used”.
    · If you select the third option, “View Belt Types”, and then click on the “Open Report” button, it will open a similar form that lists the belt types (ie. “Fan Belt”, “PTO Belt”, Deck Belt”, etc.).
    · If you select the second option, “View Tire Sizes Used”, and then click on the “Open Report” button, it will open the actual report “Tire Sizes Used”.
    · If you select the second option, “View Spark Plugs Used”, and then click on the “Open Report” button, it will open the actual report “Spark Plugs Used”.

    In short, what I am trying to do is to create a form where its contents can be executed to either open a form or a report... respectively. So if you select the "View Filter Types" line, it will open a form. While, on the other hand, if you select the "View Batteries Used" line, it will open a report.

    Any ideas???

    Thx!

    DG

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    It sounds like you want to use the Docmd.OpenReport Method
    http://msdn.microsoft.com/en-us/libr...ffice.14).aspx

    Just get the properties correct in your listbox so its .Value property returns the Report Name

  3. #3
    dgaletar is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2013
    Location
    Washington, DC
    Posts
    85
    Hey ItsMe, that would be fine except for the part about opening a form. Remember, in the list, some of them need to open a report, and others need to open a form.

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    There is a docmd.openform too.

  5. #5
    dgaletar is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2013
    Location
    Washington, DC
    Posts
    85
    Right. But how do I make it so that one button performs both functions? In other words, if you look back up at my initial issue, if you select the first option, “View Filter Types”, and then click on the “Open Report” button, it will open a similar form that lists the filter types (ie. “Oil Filters”, “Air Filters”, Fuel Filters”, etc.). Furthermore, if you then select "Oil Filters" from that list, it will open the "Oil Filters" report.

    But, at the same time, if you select the second option, “View Batteries Used”, and then click on the “Open Report” button, it will open the
    actual report “Batteries Used”.

    So while one selection opens another form, the other selection opens a report, and so on.

    And there lies my dilemma.

  6. #6
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Well, in your table that stores the report and form names you could include a column of Boolean type to indicate the type of object. Then, you VBA could do verification and use the appropriate command.

  7. #7
    dgaletar is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2013
    Location
    Washington, DC
    Posts
    85
    ...include a column of Boolean type to indicate the type of object
    I like where you are going with this!!! Tell me more about BOOLEAN. It sounds bad-ass!

    Then, you VBA could do verification...
    Please... show me!!! This is awesome!!!

  8. #8
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    You can create a yes no field in your table. When a record's Yes/No field is ticked, it returns Yes, True, and -1

    You can do validation using an If Then statement.

    If me.MyYesNoField.value = True then

    docmd.openreport
    else
    docmd.openform
    end if

  9. #9
    dgaletar is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2013
    Location
    Washington, DC
    Posts
    85
    I'm on it. I'll let you know Monday how it goes. Thx!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Create a Insert into From scratch for newbie
    By ryoka012 in forum Access
    Replies: 8
    Last Post: 04-07-2014, 04:17 PM
  2. Replies: 1
    Last Post: 12-14-2012, 09:14 AM
  3. File system menu for access
    By bob500000 in forum Access
    Replies: 13
    Last Post: 12-02-2011, 01:16 PM
  4. Image Buttons Menu type form
    By pkstormy in forum Code Repository
    Replies: 0
    Last Post: 08-30-2010, 10:17 PM
  5. Access Novice - Looking to learn from scratch.
    By Javaman in forum Database Design
    Replies: 1
    Last Post: 03-13-2010, 08:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums