Connecting Tech Pros Worldwide Forums | Help | Site Map

HELP! in my program in Visual Basic 6?

Newbie
 
Join Date: Sep 2009
Posts: 8
#1: 3 Weeks Ago
First, I want to apologize for sharing my problem to you...& for bothering..although 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=form3)

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@emailremoved.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 Thumbnails
prob.jpg  



Newbie
 
Join Date: Oct 2009
Posts: 18
#2: 3 Weeks Ago

re: HELP! in my program in Visual Basic 6?


Dear,

Is this a solution?

Project with 2 forms and each a textbox:
Expand|Select|Wrap|Line Numbers
  1. Form1 with textbox with name = F1Text1
  2. Form2 with textbox with name = F2Text1
  3.  
to copy the contents of F1Text1 to F2Text1 (for you form 1 and 2 to form 3)

=====================================
Expand|Select|Wrap|Line Numbers
  1. Private Sub F1Text1_Change()
  2. Form2.F2Text1.Text = F1Text1.Text
  3. End Sub
  4.  
  5. Private Sub Form_Load()
  6. Form2.Show
  7. End Sub
  8.  
=================================

br,
Newbie
 
Join Date: Oct 2009
Posts: 18
#3: 5 Days Ago

re: HELP! in my program in Visual Basic 6?


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=
=========================================
Expand|Select|Wrap|Line Numbers
  1. Option Explicit
  2. Dim LISTINDEX As Integer
  3.  
  4.  
  5. Private Sub Form_Load()
  6. Dim i As Integer
  7.    Form2.Show
  8. '§ populate listbox
  9.    For i = 1 To 9
  10.       List1.AddItem i
  11.    Next
  12. '§ put 1e record in textbox
  13.    F1Text1.Text = List1.List(0)
  14.    LISTINDEX = 0
  15. End Sub
  16.  
  17. Private Sub Form_Unload(Cancel As Integer)
  18. Dim i As Integer
  19.    On Error GoTo FOUT_STOPPEN
  20.    For i = Forms.Count - 1 To 1 Step -1
  21.       Unload Forms(i)
  22.    Next
  23. FOUT_STOPPEN:
  24. End Sub
  25.  
  26. Private Sub F1Text1_Change()
  27.    Form2.F2Text1.Text = F1Text1.Text
  28. End Sub
  29.  
  30. Private Sub Com_down_Click()
  31.    If LISTINDEX = 0 Then
  32.       MsgBox (" You are on the first item ")
  33.    Else
  34.       LISTINDEX = LISTINDEX - 1
  35.       F1Text1.Text = List1.List(LISTINDEX)
  36.    End If
  37. End Sub
  38.  
  39. Private Sub Com_up_Click()
  40.    If LISTINDEX = List1.ListCount - 1 Then
  41.       MsgBox (" You are on the last item ")
  42.    Else
  43.       LISTINDEX = LISTINDEX + 1
  44.       F1Text1.Text = List1.List(LISTINDEX)
  45.    End If
  46. End Sub
  47.  
  48.  
=====================================

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



br,
Attached Files
File Type: zip data from form1 to form2.zip (2.0 KB, 2 views)
Reply