Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A warning 1

Status
Not open for further replies.

samotek

Technical User
May 9, 2005
197
BG
In the Format event of my report i have a warning that gives a message in case the balance does not correspond to the number OnStore.However usually i have more than one discrepancies and i get the result as a warning message for each one.I want to get only one warning message ,if there is at least one discrepancy.What command can i give for that purpose? Furhter, can i have a control on my form, that also gives a message that siomething is worng with the data in my report ?


If Me![balance] <> Me!OnStore Then
Me!OnStore.ForeColor = 255
result = MsgBox("Something is wrong with the balance of the goods.", vbOKOnly, "Warning")
 
You could verify if a flag variable has been set before you display your messagage. Initialize a flag variable to 0 and once you display your message, set the flag to 1. It will only display the message if the flag is set to 0.
 
Thank you for your reply. Regrettably i am not a programer and the term flag is not known to me.Could you write down the code for me?
Thank you in advance
 
Dim flg as boolean

If Me![balance] <> Me!OnStore and flg = False Then
Me!OnStore.ForeColor = 255
result = MsgBox("Something is wrong with the balance of the goods.", vbOKOnly, "Warning")
flg = True
EndIf
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top