Connecting Tech Pros Worldwide Help | Site Map

Not sure how to code a loop structure...

  #1  
Old January 14th, 2009, 11:22 PM
Newbie
 
Join Date: Jan 2009
Posts: 4
Hi all,

I've got some code in a form (frmTimer) which checks another form (frmOrders) every 2 seconds to see if any new records have been added. If yes, then a MsgBox pops up on the admin's screen. I'd like to add some more similar code to frmTimer to check if a particular field (chkAcknowledged) in frmOrders has been checked off, and if yes, issue a popup MsgBox. However - the caveat is that in this case I need to be able to identify the specific record for which the chkAcknowledged check box has been checked off, e.g. "The order for 51 widgets, Order ID 22 has been acknowledged".

I'm considering doing it with a loop (perhaps For...Each) statement, where every 2 seconds frmTimer would loop through all the chkAcknowledged controls in frmOrders and check to see if chkAcknowledged.Value <> chkAcknowledged.OldValue.

I've tried reading up on looping online but I'm still not sure how to code this...can someone point me the right way with an example please? Thanks.
  #2  
Old January 14th, 2009, 11:34 PM
RuralGuy's Avatar
Expert
 
Join Date: Oct 2006
Posts: 193

re: Not sure how to code a loop structure...


What mechanism will you use to keep from duplicating the pop up messages?
  #3  
Old January 15th, 2009, 01:38 AM
Newbie
 
Join Date: Jan 2009
Posts: 4

re: Not sure how to code a loop structure...


The user who sees the popup message will click "OK" and it goes away. I'm not sure if that answers your question properly? A message should pop up when the chkAcknowledged control's value changes to True/-1. The code should be able to identify the record where the Acknowledged checkbox value changed.
  #4  
Old January 15th, 2009, 02:10 AM
RuralGuy's Avatar
Expert
 
Join Date: Oct 2006
Posts: 193

re: Not sure how to code a loop structure...


It sounds to me as though your PopUp form will need to put up the additional PopUp. Once the record is saved, unless you have a duplicate table there is no histore of a field changing.
  #5  
Old January 15th, 2009, 02:13 AM
RuralGuy's Avatar
Expert
 
Join Date: Oct 2006
Posts: 193

re: Not sure how to code a loop structure...


I guess you could have a Notification Table and make entries from the PopUp and then delete the entries when the Supervisor reviews them. Then you could watch the Notification Table from the Timer Form.
Reply

Tags
access, form, loop


Similar Threads
Thread Thread Starter Forum Replies Last Post
comp.lang.c Answers to Frequently Asked Questions (FAQ List) Steve Summit answers 0 November 14th, 2005 04:15 AM
comp.lang.c Answers to Frequently Asked Questions (FAQ List) Steve Summit answers 0 November 13th, 2005 11:37 PM
comp.lang.c Answers to Frequently Asked Questions (FAQ List) Steve Summit answers 0 November 13th, 2005 09:56 PM
comp.lang.c Answers to Frequently Asked Questions (FAQ List) Steve Summit answers 0 November 13th, 2005 03:15 AM