custom text in msgbox

  • Thread starter Thread starter DavidW
  • Start date Start date
D

DavidW

how do you take what is entered into a textbox and display it in a
messagebox

What I am wanting to do is take the date that is entered into a textbox
"date" and prompt a message box asking if that is the date they wish to use
Thanks
David
 
how do you take what is entered into a textbox and display it in a
messagebox

What I am wanting to do is take the date that is entered into a textbox
"date" and prompt a message box asking if that is the date they wish to use
Thanks
David

Something like...

If MsgBox ("Confirm Date: " & Me.txtMyTextBox, vbYesNo ) Then
'Go ahead
Else
'Cancel it
End If


- Jim
 
Jim Allensworth said:
Something like...

If MsgBox ("Confirm Date: " & Me.txtMyTextBox, vbYesNo ) Then
'Go ahead
Else
'Cancel it
End If

Actually, you'd need

If MsgBox ("Confirm Date: " & Me.txtMyTextBox, vbYesNo ) = vbYes Then
'Go ahead
Else
'Cancel it
End If

The MsgBox statement above will return either vbYes (6) or vbNo (7). Since
Access treats any non-zero value as True, you'd always be executing the 'Go
ahead action, regardless of what option the user selected.
 
Actually, you'd need

If MsgBox ("Confirm Date: " & Me.txtMyTextBox, vbYesNo ) = vbYes Then
'Go ahead
Else
'Cancel it
End If

The MsgBox statement above will return either vbYes (6) or vbNo (7). Since
Access treats any non-zero value as True, you'd always be executing the 'Go
ahead action, regardless of what option the user selected.

Ah, quite right. I forgot to include the conditional evaluation -
vbYes.

And as you point out, it is not boolean.

Thanks.

- Jim
 
Back
Top