IF statement and Form Problem (Thanks For Helping Me)

Hi guys I have 4 forms in th third form I have 3 Radio buttons (deposit,withdraw,balance) in that form I coded with if statement
if me.Radiodeposit.cheket = True do balance = balance + deposit and I coded the three fuctions but after that form it comes new form called
how much in that form I assumed the person who is going to pick on of the three fuctions (Radio buttons) he is going to put the amount that going to deposite it or withdraw in form 4 but I coded the IF statement in form 3 how I can connect the IF statement with the fourth form that has the withdraw or deposit amount because after the person he finished Enter the amount he must go to form three to ge the balance. I dont have problem with switching between the forms but my problem about IF statement in form three and the forth form.

Thanks in advance for any person going to help me.

Hamam

Comments

  • An easier way would be as follows:
    If you want the distinction between form 3 & 4 for whatever reasons, what you can do is set a flag in form3 appropriately based on the radioBttn.checked value. You can then pass this to form4 where you take in the balance. This would be I think would work. But if you wnat to go back from Form4 to form3 to retrieve the balance, that probably will not work since you will be creating a new object of form3 and you will lose earlier value.

    To avoid this from happening, you may wnat to use a static variable flag set based on redioBttn, if you want to stick to going from form4 to form3.

    -Saumil.


    : Hi guys I have 4 forms in th third form I have 3 Radio buttons (deposit,withdraw,balance) in that form I coded with if statement
    : if me.Radiodeposit.cheket = True do balance = balance + deposit and I coded the three fuctions but after that form it comes new form called
    : how much in that form I assumed the person who is going to pick on of the three fuctions (Radio buttons) he is going to put the amount that going to deposite it or withdraw in form 4 but I coded the IF statement in form 3 how I can connect the IF statement with the fourth form that has the withdraw or deposit amount because after the person he finished Enter the amount he must go to form three to ge the balance. I dont have problem with switching between the forms but my problem about IF statement in form three and the forth form.
    :
    : Thanks in advance for any person going to help me.
    :
    : Hamam
    :

  • yes Saumil I want go from form 4 (after getting how much he wants to deposit or withdraw then I have to go and check the balance) to form 3 but I am new at vb.net
    can show me example about a static variable flag and thank you for answering me.
    Hamam

    : An easier way would be as follows:
    : If you want the distinction between form 3 & 4 for whatever reasons, what you can do is set a flag in form3 appropriately based on the radioBttn.checked value. You can then pass this to form4 where you take in the balance. This would be I think would work. But if you wnat to go back from Form4 to form3 to retrieve the balance, that probably will not work since you will be creating a new object of form3 and you will lose earlier value.
    :
    : To avoid this from happening, you may wnat to use a static variable flag set based on redioBttn, if you want to stick to going from form4 to form3.
    :
    : -Saumil.
    :
    :
    : : Hi guys I have 4 forms in th third form I have 3 Radio buttons (deposit,withdraw,balance) in that form I coded with if statement
    : : if me.Radiodeposit.cheket = True do balance = balance + deposit and I coded the three fuctions but after that form it comes new form called
    : : how much in that form I assumed the person who is going to pick on of the three fuctions (Radio buttons) he is going to put the amount that going to deposite it or withdraw in form 4 but I coded the IF statement in form 3 how I can connect the IF statement with the fourth form that has the withdraw or deposit amount because after the person he finished Enter the amount he must go to form three to ge the balance. I dont have problem with switching between the forms but my problem about IF statement in form three and the forth form.
    : :
    : : Thanks in advance for any person going to help me.
    : :
    : : Hamam
    : :
    :
    :

  • This is somewhat your code should be looking like:

    In Form3:As a member of the form class:
    public static flag as integer = 0

    Then in a function (say checkFlag())you can check the flag and do the needful:
    private function checkFlag()
    If flag = 1 then
    withdraw...
    elsif flag = 2 then
    deposit...
    else
    ...
    end if
    end function

    In Form4:
    Wherever you want to call form3:
    dim objForm3 as new Form3
    objForm3.checkFlag()

    It will have the value of flag set earlier.
    -Saumil.



    : yes Saumil I want go from form 4 (after getting how much he wants to deposit or withdraw then I have to go and check the balance) to form 3 but I am new at vb.net
    : can show me example about a static variable flag and thank you for answering me.
    : Hamam
    :
    : : An easier way would be as follows:
    : : If you want the distinction between form 3 & 4 for whatever reasons, what you can do is set a flag in form3 appropriately based on the radioBttn.checked value. You can then pass this to form4 where you take in the balance. This would be I think would work. But if you wnat to go back from Form4 to form3 to retrieve the balance, that probably will not work since you will be creating a new object of form3 and you will lose earlier value.
    : :
    : : To avoid this from happening, you may wnat to use a static variable flag set based on redioBttn, if you want to stick to going from form4 to form3.
    : :
    : : -Saumil.
    : :
    : :
    : : : Hi guys I have 4 forms in th third form I have 3 Radio buttons (deposit,withdraw,balance) in that form I coded with if statement
    : : : if me.Radiodeposit.cheket = True do balance = balance + deposit and I coded the three fuctions but after that form it comes new form called
    : : : how much in that form I assumed the person who is going to pick on of the three fuctions (Radio buttons) he is going to put the amount that going to deposite it or withdraw in form 4 but I coded the IF statement in form 3 how I can connect the IF statement with the fourth form that has the withdraw or deposit amount because after the person he finished Enter the amount he must go to form three to ge the balance. I dont have problem with switching between the forms but my problem about IF statement in form three and the forth form.
    : : :
    : : : Thanks in advance for any person going to help me.
    : : :
    : : : Hamam
    : : :
    : :
    : :
    :
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion