msgbox problem

  • Thread starter Thread starter Sandra Daigle
  • Start date Start date
S

Sandra Daigle

Hi DW,

You have to call Msgbox as a function if you want to get the return value -
in the following I've used the function directly in the if condition.

If MsgBox ("Do You Need To Enter Calibration Readings?", vbYesNo +
vbQuestion, "Is Calibration Needed?")= vbNo then
cbmr.Enabled = True
cemr.Enabled = True
cpg.Enabled = True
cbmr.SetFocus
Command18.Enabled = False
Else
End If

You could also set a variable based on the function return value:

dim intI as integer
intI=MsgBox ("Do You Need To Enter Calibration Readings?", vbYesNo +
vbQuestion, "Is Calibration Needed?")

if intI = vbNo then
'do stuff
else
endif



ra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.
 
What I knew does me anything seems like with vb6.2
anyhow I am having a little problem getting the results of a vbyesno, here
is the code, can you point out what I did wrong

Private Sub Command18_Click()
If Command18.Enabled = True Then
MsgBox "Do You Need To Enter Calibration Readings?", vbYesNo + vbQuestion,
"Is Calibration Needed?"
If vbNo Then
cbmr.Enabled = True
cemr.Enabled = True
cpg.Enabled = True
cbmr.SetFocus
Command18.Enabled = False
Else
End If
End If
End Sub
 
Back
Top