Program in Visual Basic 6?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • psyvanz
    New Member
    • Sep 2009
    • 26

    Program in Visual Basic 6?

    First, I want to apologize for sharing my problem to you...& for bothering..alth ough sharing is good..x)

    Second, This is an enrollment system. I made a 3 tables in MS ACCESS 2007 database.

    i used DATAENVIRONMENT in connecting it in the DATAGRID..

    3rd, is my Problem...

    table1 for student information (no problem) FORM1 in vb6
    table2 for course and subjects (no problem) FORM2 in vb6
    table3 for combination of student info. and course and subjects (MY BIG PROBLEM) FORM3 in vb6

    I mean, in assigning the "course" and the "subjects" for a "student" who want to enroll...

    (form1+form2=fo rm3)

    I hope you understand my problem.. i want a code or if you have sample related to this matter, and you may send it at psyvanz@emailre moved.com

    HELP ME ASAP... PLEASE... I hope you will share it for FREE...

    Your help is much appreciated...

    Thanks in advance... GOD bless...

    below i attached my form1/2/3 to understand my problem...
    Attached Files
    Last edited by Dököll; Nov 21 '09, 03:30 AM. Reason: email removed, against site rules:-)
  • Guido Geurs
    Recognized Expert Contributor
    • Oct 2009
    • 767

    #2
    Dear,

    Is this a solution?

    Project with 2 forms and each a textbox:
    Code:
    Form1 with textbox with name = F1Text1
    Form2 with textbox with name = F2Text1
    to copy the contents of F1Text1 to F2Text1 (for you form 1 and 2 to form 3)

    =============== =============== =======
    Code:
    Private Sub F1Text1_Change()
    Form2.F2Text1.Text = F1Text1.Text
    End Sub
    
    Private Sub Form_Load()
    Form2.Show
    End Sub
    =============== =============== ===

    br,
    Last edited by Dököll; Nov 21 '09, 03:31 AM. Reason: code tags...

    Comment

    • Guido Geurs
      Recognized Expert Contributor
      • Oct 2009
      • 767

      #3
      dear,

      I have tried to simulate your problem with a listbox.
      It works for me.

      Add to my previous example:
      command = com_down
      command = com_up
      listbox = list1

      this is the new code=
      =============== =============== ===========
      Code:
      Option Explicit
      Dim LISTINDEX As Integer
      
      
      Private Sub Form_Load()
      Dim i As Integer
         Form2.Show
      '§ populate listbox
         For i = 1 To 9
            List1.AddItem i
         Next
      '§ put 1e record in textbox
         F1Text1.Text = List1.List(0)
         LISTINDEX = 0
      End Sub
      
      Private Sub Form_Unload(Cancel As Integer)
      Dim i As Integer
         On Error GoTo FOUT_STOPPEN
         For i = Forms.Count - 1 To 1 Step -1
            Unload Forms(i)
         Next
      FOUT_STOPPEN:
      End Sub
      
      Private Sub F1Text1_Change()
         Form2.F2Text1.Text = F1Text1.Text
      End Sub
      
      Private Sub Com_down_Click()
         If LISTINDEX = 0 Then
            MsgBox (" You are on the first item ")
         Else
            LISTINDEX = LISTINDEX - 1
            F1Text1.Text = List1.List(LISTINDEX)
         End If
      End Sub
      
      Private Sub Com_up_Click()
         If LISTINDEX = List1.ListCount - 1 Then
            MsgBox (" You are on the last item ")
         Else
            LISTINDEX = LISTINDEX + 1
            F1Text1.Text = List1.List(LISTINDEX)
         End If
      End Sub
      =============== =============== =======

      I have tried to find the control with "dataenvironmen t" but can't find it !
      VB help says it is from FoxPro ????



      br,
      Attached Files

      Comment

      Working...