VB6 - Displaying messages using a form (1 Viewer)

Elvis

Registered User.
Local time
Today, 15:02
Joined
Sep 28, 2001
Messages
26
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
 

Travis

Registered User.
Local time
Today, 07:02
Joined
Dec 17, 1999
Messages
1,332
Your code will continue to run when you open a form, unless you open the form with the "vbModal" variable. The code will hang there until the form Object is closed.
 

Elvis

Registered User.
Local time
Today, 15:02
Joined
Sep 28, 2001
Messages
26
Thanks for the reply Travis. I had played around with opening the for Modal but had the syntax wrong added

FORM1.SHOW vbModal

and all works fine now
 

Users who are viewing this thread

Top Bottom