Results 1 to 2 of 2

Thread: [RESOLVED] Advices for 2 Forms, same buttons, box, functions but 1 difference ?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2012
    Location
    Toulouse, France
    Posts
    21

    Resolved [RESOLVED] Advices for 2 Forms, same buttons, box, functions but 1 difference ?

    Hi,

    In my application for Pocket PC, CF 3.5, WM 5.0, I have 2 forms almost identical... One is for customers, the other one for guests.
    The only difference, is in my select requests, I use to difference them a value like 1 for customers, 0 for others.

    So I tried to do something like this:

    FORMA:
    Code:
    sub pro()
    {
          SetDataSet("Select * FROM users WHERE type = 1", SDS)
          treatment(SDS);
    }
    FORMB:
    Code:
    sub guest()
    {
          SetDataSet("Select * FROM users WHERE type = 0", SDS)
          treatment(SDS);
    }
    MODULE:
    Code:
    function treatment(SDS..)
    {
          ...
          ...
          if (something = true) then
                TextBox1.Text = "MyValue"
          else
                TextBox1.Text = "MyOtherValue"
          endif
          ...
    }
    My problem is that I get " TextBox1.Text is not declared ". Yes, but I can't say if it's FORMA.Texbox1 or FORMB.Textbox1 !
    Do you have any advices, I didn't try in this example, but one day I tried to do something like this :

    Code:
    ExitForm(Byval o as system.object)
    {
         o.close()
    }
    FormA
    Code:
    sub {
         oclose(Me)
    }
    And it didn't works, maybe because it's for pocketPC..

    Thank you!

  2. #2
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,206

    Re: Advices for 2 Forms, same buttons, box, functions but 1 difference ?

    If the only difference is the value in the select string then why not use the same form?

    Not sure what you were trying to do with the close stuff

    The code you have posted look slike it is mixing C# and VB syntax. I would expect it to fail in several places

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width