Solved

Display Access 2007 Form one record at a time

Posted on 2014-04-06
3
881 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 37

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
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 …
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…

734 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