To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
VBForums  

VB Wire News
Sell Your Code and Make Money?
Creating your own Tetris game using VB.NET
Article :: Improving Software Economics, Part 4 of 7: Top 10 Principles of Iterative Software Management
Building Composable Apps in .NET 4 with the Managed Extensibility Framework
CLR Inside Out: Formatting and Parsing Time Intervals in the .NET Framework 4



Go Back   VBForums > Visual Basic > Visual Basic 6 and Earlier

Reply Post New Thread
 
Thread Tools Search this Thread Display Modes
Old Feb 7th, 2007, 11:01 AM   #1
mheiy
Lively Member
 
Join Date: Nov 06
Posts: 84
mheiy is an unknown quantity at this point (<10)
helppppp

can anyone help me with this because when i adding or clicking he cmdComplete the .eof is always false thats why i can


VB Code:
  1. Option Explicit
  2. Public State As FormState
  3. Dim rsr As String 'for reservation string
  4. Dim a As Variant
  5. Sub rload()
  6. Set tbCourse = New ADODB.Recordset
  7. tbCourse.Open "SELECT * FROM tbcourse ", cn, adOpenStatic, adLockReadOnly
  8. End Sub
  9. Private Sub cmbCourse_Click()
  10. a = cmbCourse.Text
  11. Call rload
  12.  Do While tbCourse!CourseName <> a
  13.  tbCourse.MoveNext
  14.  If tbCourse!CourseName = a Then
  15.  txtBatch.Text = tbCourse!BatchNumber
  16.     End If
  17. Loop
  18. End Sub
  19. Private Sub cmdCancel_Click()
  20. ans = MsgBox("Are you sure you want to cancel this?", vbYesNo + vbQuestion, " Titus School of Multimedia")
  21.     If ans = vbYes Then
  22.       Unload Me
  23. '      tbInquiry.Close
  24.     End If
  25. End Sub
  26. Private Sub cmdCheckAvail_Click()
  27. If CheckTextBox(cmbCourse, "Invalid 'COURSE' value. This field is required, please enter a value.") = False Then
  28. ElseIf CheckTextBox(txtBatch, "Invalid 'BATCH NUMBER' value. This field is required, please enter a value.") = False Then
  29. ElseIf frmCheckAvail.txtReser(4).Text = 0 Then
  30.     MsgBox "No seat/s available", vbInformation, "Titus School of Multimedia"
  31. Else
  32.     frmCheckAvail.Show
  33. End If
  34. End Sub
  35. Private Sub cmdComplete_Click()
  36. If CheckTextBox(cmbCourse, "Invalid 'COURSE' value. This field is required, please enter a value.") = False Then
  37.    
  38. ElseIf CheckTextBox(txtBatch, "Invalid 'BATCH NUMBER' value. This field is required, please enter a value.") = False Then
  39.    
  40. ElseIf CheckTextBox(txtNoSeat, "Invalid 'NO. OF SEAT' value. This field is required, please enter a value.") = False Then
  41.    
  42. ElseIf CheckTextBox(txtAppID, "You cannot move to this part unless you have created New Applicant ID.") = False Then
  43.     StartTxt txtAppID
  44. ElseIf CheckTextBox(txtAppInfo(0), "Invalid 'FIRST NAME' value. This field is required, please enter a value.") = False Then
  45.     StartTxt txtAppInfo(0)
  46. ElseIf CheckTextBox(txtAppInfo(1), "Invalid 'Middle Name' value. This field is required, please enter a value.") = False Then
  47.     StartTxt txtAppInfo(1)
  48. ElseIf CheckTextBox(txtAppInfo(2), "Invalid 'LAST NAME' value. This field is required, please enter a value.") = False Then
  49.     StartTxt txtAppInfo(2)
  50. ElseIf CheckTextBox(txtAppInfo(3), "Invalid 'ADDRESS' value. This field is required, please enter a value.") = False Then
  51.     StartTxt txtAppInfo(3)
  52. ElseIf CheckTextBox(txtAppInfo(4), "Invalid 'CONTACT NO' value. This field is required, please enter a value.") = False Then
  53.     StartTxt txtAppInfo(4)
  54. Else
  55.        With tbInquiry
  56.           .Open
  57.            .MoveFirst
  58.             .Find "ApplicantID = '" & txtAppID & "'"
  59.             If .EOF = True Then
  60.                 .AddNew
  61.                 AddFields
  62.                 .Update
  63.                 .Requery
  64.              End If
  65.         End With
  66.        
  67.        
  68.     ans = MsgBox("New reservation entry successfully saved to the record." & vbNewLine & "Do You Want To Add Another Record?", vbYesNo, "Titus School Of Multimedia")
  69.     If ans = vbNo Then
  70.         Unload Me
  71.     End If
  72.        
  73.      
  74. End If
  75. End Sub
  76. Private Sub cmdSearch_Click()
  77. frmSearch.Show
  78. End Sub
  79. Private Sub Form_Load()
  80. Dim cmb As ListItem
  81. Set tbInquiry = Nothing
  82. tbInquiry.Open "Select * from tbinquiry", cn, adOpenDynamic, adLockOptimistic
  83. tbCourse.Open "Select * from tbCourse", cn, adOpenDynamic, adLockOptimistic
  84.  
  85. With tbInquiry
  86.     frmInquiryForm.txtAppInfo(0).Text = frmAddReservation.txtAppInfo(0).Text
  87.     frmInquiryForm.txtAppInfo(1).Text = txtAppInfo(1).Text
  88.     frmInquiryForm.txtAppInfo(2).Text = txtAppInfo(2).Text
  89.     frmInquiryForm.txtAppInfo(3).Text = txtAppInfo(3).Text
  90.     frmInquiryForm.txtAppInfo(4).Text = txtAppInfo(4).Enabled = True
  91. End With
  92. With tbCourse
  93.  If .BOF = True And .EOF = True Then
  94.         Refresh
  95.     Else
  96.         Do Until .EOF
  97.             cmbCourse.AddItem (.Fields(0))
  98.            ' cmbBatch.AddItem (.Fields(2))
  99.             .MoveNext
  100.         Loop
  101.     End If
  102. End With
  103. End Sub
  104. Private Sub AddFields()
  105. With tbInquiry
  106.     .Fields(0) = txtAppID
  107.     .Fields(1) = txtAppInfo(0)
  108.     .Fields(2) = txtAppInfo(1)
  109.     .Fields(3) = txtAppInfo(2)
  110.     .Fields(4) = txtAppInfo(3)
  111.     .Fields(5) = txtAppInfo(4)
  112.     .Fields(6) = txtTFA
  113.     '.Fields(7) = creationdate
  114.     .Fields(8) = cmbCourse.Text
  115.     .Fields(9) = txtBatch
  116.     .Fields(10) = txtNoSeat
  117.     .Fields(11) = txtdateReserved
  118.     .Fields(12) = txtEndReserved
  119.     .Fields(13) = "Reserved"
  120.    
  121. End With
  122. End Sub
  123. Private Sub EraseAll()
  124. For i = 0 To 4
  125. txtAppInfo(i) = ""
  126. Next i
  127. txtAppInfo(0).SetFocus
  128. For i = 0 To 4
  129. optTFA(i) = ""
  130. Next i
  131. End Sub
  132. Private Sub Form_Unload(Cancel As Integer)
  133. 'tbReservation.Close
  134. End Sub
  135. '
  136. 'Private Sub txtNoSeat_LostFocus()
  137. 'With tbCourse
  138. '    .Fields(4) = txtNoSeat.Text - .Fields(1)
  139. 'End With
  140. '
  141. 'End Sub
  142.  
mheiy is offline   Reply With Quote
Old Feb 7th, 2007, 11:08 AM   #2
danasegarane
Learning .Net
 
danasegarane's Avatar
 
Join Date: Aug 04
Location: VBForums
Posts: 4,625
danasegarane is a glorious beacon of light (400+)danasegarane is a glorious beacon of light (400+)danasegarane is a glorious beacon of light (400+)danasegarane is a glorious beacon of light (400+)danasegarane is a glorious beacon of light (400+)
Re: helppppp

VB Code:
  1. tbInquiry.open "Select * from tbcourse where ApplicantID = '" & txtAppID & "'", cn, adOpenStatic, adLockReadOnly
  2.    If tbInquiry.EOF = True Then
  3.         With tbInquiry
  4.                  .AddNew
  5.                 AddFields
  6.                 .Update
  7.         End If
  8.    End If
__________________
Please mark you thread resolved using the Thread Tools as shown

If my post was helpful to you, then Rate it

Tier Architecture
danasegarane is offline   Reply With Quote
Old Feb 7th, 2007, 11:42 AM   #3
mheiy
Lively Member
 
Join Date: Nov 06
Posts: 84
mheiy is an unknown quantity at this point (<10)
Re: helppppp

what about if i dont have a record on my table and i will add a new one i always got an error of either .eof or .bof is true, or current recordset are closed.opretaions requires a record
VB Code:
  1. Private Sub cmdSave_Click()
  2. If CheckTextBox(txtDepTitle, "Invalid 'DEPARTMENT Title' value. This field is required, please enter a value.") = False Then
  3.          StartTxt txtDepTitle
  4. Else
  5.        With tbDepartment
  6.            .MoveFirst
  7.             .Find "DepartmentName = '" & txtDepTitle & "'"
  8.             If .EOF = True Then
  9.                 .AddNew
  10.                 .Fields(0) = txtDepTitle
  11.                 .Update
  12.                 .Requery
  13.              End If
  14.         End With
  15.    
  16.     ans = MsgBox("New Deparment entry successfully saved to the record." & vbNewLine & "Do You Want To Add Another Record?", vbYesNo, "Titus School Of Multimedia")
  17.     If ans = vbNo Then
  18.         Unload Me
  19.     End If
  20.    
  21. End If
  22.    
  23. End Sub
  24. Private Sub Form_Load()
  25. tbDepartment.Open "Select * from tbdepartment where 1<>1", cn, adOpenDynamic, adLockOptimistic
  26. End Sub
mheiy is offline   Reply With Quote
Old Feb 7th, 2007, 12:22 PM   #4
mheiy
Lively Member
 
Join Date: Nov 06
Posts: 84
mheiy is an unknown quantity at this point (<10)
Re: helppppp

are u there daragesagane
mheiy is offline   Reply With Quote
Reply

Go Back   VBForums > Visual Basic > Visual Basic 6 and Earlier


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 02:29 AM.




To view more projects, click here

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.