Solved

Access 2000 Close Start Form if checked "Yes"

Posted on 2002-04-02
3
182 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
ID: 6913093
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
ID: 6913448
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
ID: 6913766
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

863 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

20 Experts available now in Live!

Get 1:1 Help Now