Solved

Display Access 2007 Form one record at a time

Posted on 2014-04-06
3
862 Views
Last Modified: 2014-04-07
Hi
I'm trying to display Reminder Notice forms when a user opens their Access 2007 database via the autoexec() function.
I have a table that holds Reminder Notices - some in an Open status and othes in a Closed status
I have a query that selects the open Reminder Notice records where the Reminder Notice Date equals the current system date - maybe say 4 or 5 records selected.  

I then walk throught this query and write a single record to a temporaty table which in turn is the record source of the Reminder Notice form I wish to display.

After displaying the Reminder Notice form - where the user has the option to basically ignore the form (Remind me later) or to flag that the Reminder Notice is to be closed.

After clicking on the "Remind Me Later" or "Close" button (which basically executes some On-Click event logic it then closes the Reminder Notice form) the logic returns to the next statement after the Open form statement and retrieves the next Reminder Notice record and so on until all the open Reminder Notices have been processed.

That's the logic but the reality is that it only displays the last Reminder Notice.

I've walked through the logic in debug mode and it displays a Reminder Notice Form but then continues on immediately to read the next Reminder Notice record without stopping to allow the user to read the Reminder Notice or to take what ever action they need to take .  It only stops to display the Reminder Notice form after the last Reminder Notice record has been processed.

How can I get the system to stop after displaying a Reminder Notice form before continuing on to the next Reminder Notice record?
 
Many thanks in advance for you help/suggestions

Michael Adler
ReminderNoticLogic.txt
0
Comment
Question by:Adlerm
3 Comments
 
LVL 61

Accepted Solution

by:
mbizup earned 200 total points
ID: 39982606
You haven't shown your logic (macro) for actually opening the reminder notice form.

To pause program execution when the popup form is open, you need to open it in dialog mode.

In VBA, this would be:

DoCmd.OpenForm "YourReminderForm", WindowMode := acDialog

Open in new window

If you are using a macro to open the form, you would also have to specify "Dialog" for the window mode.

Doing this pauses code execution while the window is open and resumes execution once the user closes the form.
0
 
LVL 34

Expert Comment

by:PatHartman
ID: 39983192
It sounds like you've written a lot of code that isn't necessary.  Access handles bound forms all by itself.  It populates the controls, saves the record and by using the navigation control allows you to move back and forth through the recordset.  All without code.

Copying the selected records to a table is not necessary.  Bind the form to the select query.  That way you can eliminate code.  Also, if this is a multi-user database, unless you are creating the temp table in the FE, you run the risk of users interfering with each other by overlaying the temp table.  Creating temp tables leads to database bloat and will require you to compact and repair at regular intervals to keep the database size under control.

With the form bound to the select query, the user can take whatever action he needs with the first record and then use the navigation bar to move to the next record.  You can sort of force this by requerying the form in the Form's AfterUpdate event.  As long as the user changed something that will cause the record to not be selected, it will drop out of the recordset since it will no longer satisfy the criteria for selection.  The only code required to implement this is the requery.
0
 

Author Comment

by:Adlerm
ID: 39983215
Hi Mbiup

The points are yours - thanks very much for your help.

Michael
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
User Beware!  This is a rather permanent solution to removing your email from an exchange server.  The only way to truly go back is to have your exchange administrator restore your mailbox from backups.  This is usually the option of last resort.  A…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

759 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

22 Experts available now in Live!

Get 1:1 Help Now