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

Not sure how to code a loop structure...

P: 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.
Jan 14 '09 #1
Share this Question
Share on Google+
4 Replies


RuralGuy
Expert 100+
P: 375
What mechanism will you use to keep from duplicating the pop up messages?
Jan 14 '09 #2

P: 4
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.
Jan 15 '09 #3

RuralGuy
Expert 100+
P: 375
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.
Jan 15 '09 #4

RuralGuy
Expert 100+
P: 375
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.
Jan 15 '09 #5

Post your reply

Sign in to post your reply or Sign up for a free account.