Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Get value from Mutiple fom

Get value from Mutiple fom

Scheduled Pinned Locked Moved Visual Basic
tutorialquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sarfaraj Ahmed
    wrote on last edited by
    #1

    Hello Everybody I have 3 form on my project 1. frmNewOrder (have a button called btnPayment also have orderID) 2. frmExistingOrder (have a button called btnPayment also have orderID) 3. frmPayment when you click btnPayment from frmNewOrder or frmExistingOrder then how can I send orderID value to frmPayment I have done something Public Shared OrderID As Integer (on frmNewOrder) I put code on frmOrder page load events orderID = frmNewOrder.OrderID I know its really a wrong concept. Any idea or example will be really helpful Thanks in Advance

    Sarfarj Ahmed

    N J 2 Replies Last reply
    0
    • S Sarfaraj Ahmed

      Hello Everybody I have 3 form on my project 1. frmNewOrder (have a button called btnPayment also have orderID) 2. frmExistingOrder (have a button called btnPayment also have orderID) 3. frmPayment when you click btnPayment from frmNewOrder or frmExistingOrder then how can I send orderID value to frmPayment I have done something Public Shared OrderID As Integer (on frmNewOrder) I put code on frmOrder page load events orderID = frmNewOrder.OrderID I know its really a wrong concept. Any idea or example will be really helpful Thanks in Advance

      Sarfarj Ahmed

      N Offline
      N Offline
      nlarson11
      wrote on last edited by
      #2

      how are you creating a new instance of frmPayment? in the click event of btnPayment correct? Pass the value into frmPayment after creating the instance. dim frmPay as new frmPayment frmPay.OrderID = me.OrderID frmPay.showdialog

      'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous 'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous

      S 1 Reply Last reply
      0
      • N nlarson11

        how are you creating a new instance of frmPayment? in the click event of btnPayment correct? Pass the value into frmPayment after creating the instance. dim frmPay as new frmPayment frmPay.OrderID = me.OrderID frmPay.showdialog

        'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous 'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous

        S Offline
        S Offline
        Sarfaraj Ahmed
        wrote on last edited by
        #3

        thnks for ur reply i have already solved my problem form google help thank u very much

        Sarfarj Ahmed

        1 Reply Last reply
        0
        • S Sarfaraj Ahmed

          Hello Everybody I have 3 form on my project 1. frmNewOrder (have a button called btnPayment also have orderID) 2. frmExistingOrder (have a button called btnPayment also have orderID) 3. frmPayment when you click btnPayment from frmNewOrder or frmExistingOrder then how can I send orderID value to frmPayment I have done something Public Shared OrderID As Integer (on frmNewOrder) I put code on frmOrder page load events orderID = frmNewOrder.OrderID I know its really a wrong concept. Any idea or example will be really helpful Thanks in Advance

          Sarfarj Ahmed

          J Offline
          J Offline
          Jay Royall
          wrote on last edited by
          #4

          Hi, If frmPayment isn't equal to nothing then you can set a variable in frmPayment through a public property. e.g. in frmPayment:

          dim intOrderId as integer

          Public WriteOnly Property OrderID() as Integer
          Set(byval value as Integer)
          intOrderId = value
          End Set
          end property

          and in frmNewOrder:

          frmMyPayment.OrderID = orderID

          However, if frmPayment is not yet initialised, you can call the new constructor passing the orderid as a parameter. e.g. in frmPayments:

          public sub new(byval orderID as integer)
          me.intOrderID = orderID
          end sub

          and in and in frmNewOrder:

          Dim frmMyPayment as new frmPayment(orderid)

          Is this OK?

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups