Solved

Access 2000 Close Start Form if checked "Yes"

Posted on 2002-04-02
3
178 Views
Last Modified: 2011-09-20
Access 2000

I have a startup disclaimer form with two option check boxes: 1 = Agree, 2 = Disagree

- Table Name: tblNoticeDisclaimer
- Field Name: Agree
- Data Type: Number
- Form Name: frmNoticeDisclaimer

and then I have a main menu form "frmMenu"

I wish the disclaimer form to open first "Not a problem", then if the user has already viewed the disclaimer, and checked the box as "Accepted" (option value 1) open the main menu form, and never show the disclaimer form again when the database is being opened.

However, if the user checks the "Do Not Accept" (option value 2) box, then close the database, and keep it closed. i.e. if the user tries to open the database again, it opens sees that the "Do Not Accpted" option has been checked then closes.

Guidance Welcome :-)

0
Comment
Question by:DWB
3 Comments
 
LVL 1

Accepted Solution

by:
Dan_Morris earned 50 total points
Comment Utility
Use an autoexec macro to run some code that will open your disclaimer form if field: Agree is null

open your menu if Agree is True

of close your database if Agree is false

Public Function CheckDisclaimer()

  dim var as variant

  var = DLookup("Agree", "tblNoticeDisclaimer")

  Select Case var
     Case Null
        docmd.openform "frmNoticeDisclaimer"
     Case 1
        docmd.openform "frmMenu"
     Case 2
        'add timer code to "frmNoticeDisclaimer" to close itself after a few seconds
        docmd.openform "frmNoticeDisclaimer", View:=acNormal, WindowMode:=acDialog
        docmd.quit
  End select
End Function


Add a function similar to this to a module.  Create a macro named autoexec and select run code, specify the name of the function/sub to run.

Note: this does however fall prey to the shift-key bypass that Access has when opening.

Hope this helps,

Dan
0
 
LVL 54

Expert Comment

by:nico5038
Comment Utility
I guess your disclaimer is linked to a table.
In the autoexec you test for the Option to be "Agree" and skip the form.
In the other case however ( "Disagree" or empty) you should just show the form and not issue a Close of the database...

Nic;o)
0
 

Author Comment

by:DWB
Comment Utility
Thank you very much for your responses!  

Sorry for the delay, however I normally receive a response via email, and for some reason that did not happen this time, regardless, all well, that ends well.

Dan, I've used your option, and it appears to work well; thank you!

nico5038, I like your idea about just re-showing the form vice closing the database, thanks!

Another happy customer served :-)

Cheers

Dave
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now