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
Solved

Display Access 2007 Form one record at a time

Posted on 2014-04-06
3
871 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 35

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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Many companies are making the switch from Microsoft to Google Apps (https://www.google.com/work/apps/business/). Use this article to learn more about what Google Apps has to offer and to help if you’re planning on migrating to Google Apps. It is …
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

808 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