I have a single form which I have created to display a message. I search a database check certain fields and if applicable would like to display a message using this form. Now this kind of works if I use a msgbox to display the message its fine. I can change the fields on the form but I was hoping to transfer the control to the form and on closing the form transfer control back to the next record in the do loop, but it seems to skip to the last record in the do loop before transferring control to the form. Any one any ideas on how I can acheive what I am trying to do. Below is the code I am using. Appreciate any help you guys can give me.
RST.Open "Employees", CNN, , , adCmdTable
Do Until RST.EOF
if Date = <whatever> then
ExName = RST.Fields(1).Value & " " & RST.Fields(2).Value
MyDate = RST.Fields(3).Value
MsgBox "Its " & ExName & " today"
lblName.Caption = ExName
end if
RST.MoveNext
Loop
RST.Open "Employees", CNN, , , adCmdTable
Do Until RST.EOF
if Date = <whatever> then
ExName = RST.Fields(1).Value & " " & RST.Fields(2).Value
MyDate = RST.Fields(3).Value
MsgBox "Its " & ExName & " today"
lblName.Caption = ExName
end if
RST.MoveNext
Loop