hehe, Cant believe Im stuck on this...

This is my IF Else statment Im throughing it a few arguements and it does not like my || OR sybols and ive tryed && It does not seem to let me put more then one arguement.

Just want to test the text fields to see they have any data in them before the code continues... Really cant believe Im stuck on this... maybe I play with to many languages... or tired!

If someone could steer me in the correct dirrection please feel free or even a suggestion.

if
(cmb_MembType.Text = "" || txt_PostCode.Text = "" || txt_FName.Text = "" || txt_LName.Text = "" || txt_Email.Text = "" || txt_Suburb.Text = "")

{

MessageBox.Show("Please Check Your Data");

txt_FName.Focus();

return;

}

Thank you
Binary




Answer this question

hehe, Cant believe Im stuck on this...

  • James Dean

    Hehe, yeah I was playing with ASP earlier today... pity there was not just one language since most do the same thing with basicly the same concept!

    Stuffs me up every time the change of languages...
    Thanks for the heads up.
    Binary


  • Fiona Hughes

    You problem is that you're using = instead of ==. 

    if(cmb_MembType.Text == "" || txt_PostCode.Text == "" || txt_FName.Text == "" || txt_LName.Text == "" || txt_Email.Text == "" || txt_Suburb.Text == "")

    I do the opposite whenever I do little VB.NET projects to answer questions here.


  • hehe, Cant believe Im stuck on this...