putting the response from the msgbox to the data file vb6

  • Thread starter Thread starter pololotsrus
  • Start date Start date
P

pololotsrus

prompt1 = "Thank You"
prompt = "Would you like to be placed in a mailing list?"
title = "Question"
buttons = vbYesNo
list = MsgBox("Would you like to be placed in a mailing list?",
vbYesNo, "Question")

If (txtcustomer.Text <> "") And (txtdestination.Text <> "") And
(txttickets.Text <> "") Then
Open "Mailinglist.txt" For Append As #1
Write #1, txtcustomer.Text, txtdestination.Text, txttickets.Text, list
Close #1

Can someone help me out I have no idea how i can add the response from
the msgbox to the mailinglist.txt file either saying yes or no
 
Hi,

Use the following code:

if MsgBox("Would you like to be placed in a mailing list?", vbYesNo,
"Question") = vbYes then
If (txtcustomer.Text <> "") And (txtdestination.Text <> "") And
(txttickets.Text <> "") Then
Open "Mailinglist.txt" For Append As #1
Write #1, txtcustomer.Text, txtdestination.Text, txttickets.Text, list
Close #1
end if
else
msgbox "Sorry you don't want to be on the mailing list", vbInformation

end if

Hope that helps.

Damian.
 

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

Back
Top