custom text in msgbox

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
 
J

Jim Allensworth

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
 
D

Douglas J. Steele

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.
 
J

Jim Allensworth

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top