?
Solved

Display Access 2007 Form one record at a time

Posted on 2014-04-06
3
Medium Priority
?
894 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 800 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 38

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

777 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