Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Access 2000 Close Start Form if checked "Yes"

Posted on 2002-04-02
3
Medium Priority
?
207 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 200 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

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

927 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