Solved

Access 2000 Close Start Form if checked "Yes"

Posted on 2002-04-02
3
185 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
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…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

770 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