By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,391 Members | 1,810 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,391 IT Pros & Developers. It's quick & easy.

Pausing between forms

P: n/a
I am using Access 97. I would like to be able to pause between forms.

For example, I have 2 reminders I would like displayed separately, one
at a time. Here is part of the code I am using.

If Not rstReminders.EOF Then
rstReminders.MoveFirst
While Not rstReminders.EOF
strReminder = rstReminders!Reminder
strEventCaption = rstReminders!EventCaption

DoCmd.OpenForm "frmMessage"
Forms!frmMessage.Caption = strEventCaption
Forms!frmMessage!txtReminder = strReminder

rstReminders.MoveNext
Wend
End If

Making the form a Dialog form by adding acDialog does not work because
then I cannot set the Message Caption or the reminder.

I also tried adding DoEvents and Wait (found on Microsoft's site) to no
avail. I know that I can insert a MsgBox statement to halt the code
until the user clicks on okay but I want it to halt and have the user
click on the OK button of the frmMessage.

Does anyone have any suggestions? Thank you,
Deborah

Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Deborah V. Gardner wrote:
I am using Access 97. I would like to be able to pause between forms.

For example, I have 2 reminders I would like displayed separately, one
at a time. Here is part of the code I am using.

If Not rstReminders.EOF Then
rstReminders.MoveFirst
While Not rstReminders.EOF
strReminder = rstReminders!Reminder
strEventCaption = rstReminders!EventCaption

DoCmd.OpenForm "frmMessage"
Forms!frmMessage.Caption = strEventCaption
Forms!frmMessage!txtReminder = strReminder

rstReminders.MoveNext
Wend
End If

Making the form a Dialog form by adding acDialog does not work because
then I cannot set the Message Caption or the reminder.

I also tried adding DoEvents and Wait (found on Microsoft's site) to
no avail. I know that I can insert a MsgBox statement to halt the code
until the user clicks on okay but I want it to halt and have the user
click on the OK button of the frmMessage.

Does anyone have any suggestions? Thank you,
Deborah

In the form that runs this code, change it to see if there are are
records in rstReminder. If there are,
open the frmMessage form and have it loop thru the reminder file
displaying the reminders. Use a
click button to have the loop go to the next record. When completed,
close the frmMessage form.

Ron
--

Ronald W. Roberts
Roberts Communication
rw*******************@robcom.com
To reply remove "_at_robcom_dot_com"

Nov 12 '05 #2

P: n/a
On Sun, 22 Feb 2004 04:44:15 GMT, Deborah V. Gardner wrote:
I am using Access 97. I would like to be able to pause between forms.

For example, I have 2 reminders I would like displayed separately, one
at a time. Here is part of the code I am using.

If Not rstReminders.EOF Then
rstReminders.MoveFirst
While Not rstReminders.EOF
strReminder = rstReminders!Reminder
strEventCaption = rstReminders!EventCaption

DoCmd.OpenForm "frmMessage"
Forms!frmMessage.Caption = strEventCaption
Forms!frmMessage!txtReminder = strReminder

rstReminders.MoveNext
Wend
End If

Making the form a Dialog form by adding acDialog does not work because
then I cannot set the Message Caption or the reminder.

I also tried adding DoEvents and Wait (found on Microsoft's site) to no
avail. I know that I can insert a MsgBox statement to halt the code
until the user clicks on okay but I want it to halt and have the user
click on the OK button of the frmMessage.

Does anyone have any suggestions? Thank you,
Deborah


You can use acDialog to open the form, but you'll need to pass your caption
and message before you open the form. A quick and simple way is to delcare
strReminder and strEventCaption as public to the project, then just open
the form as acDialog. In the Open event of the message form, use those
public variables to set the caption and message.

A better, but slighlty more complicated way is to pass strReminder and
strEventCaption as the OpenArgs setting of the DoCmd.OpenForm. You'll need
to format them in a way that you can use InStr() to extract them reliably

--
Mike Storr
www.veraccess.com
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.