Connecting Tech Pros Worldwide Help | Site Map

Not sure how to code a loop structure...

 
LinkBack Thread Tools Search this Thread
  #1  
Old January 14th, 2009, 10:22 PM
Newbie
 
Join Date: Jan 2009
Posts: 4
Default Not sure how to code a loop structure...

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.
Reply
  #2  
Old January 14th, 2009, 10:34 PM
RuralGuy's Avatar
Expert
 
Join Date: Oct 2006
Age: 64
Posts: 184
Default

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

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.
Reply
  #4  
Old January 15th, 2009, 01:10 AM
RuralGuy's Avatar
Expert
 
Join Date: Oct 2006
Age: 64
Posts: 184
Default

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.
Reply
  #5  
Old January 15th, 2009, 01:13 AM
RuralGuy's Avatar
Expert
 
Join Date: Oct 2006
Age: 64
Posts: 184
Default

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
Reply

Bookmarks

Tags
access, form, loop

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.