Solved

Display Access 2007 Form one record at a time

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

930 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

13 Experts available now in Live!

Get 1:1 Help Now