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.  
  3. If CheckTextBox(txtDepTitle, "Invalid 'DEPARTMENT Title' value. This field is required, please enter a value.") = False Then
  4.          StartTxt txtDepTitle
  5. Else
  6.        With tbDepartment
  7.            .MoveFirst
  8.             .Find "DepartmentName = '" & txtDepTitle & "'"
  9.             If .EOF = True Then
  10.                 .AddNew
  11.                 .Fields(0) = txtDepTitle
  12.                 .Update
  13.                 .Requery
  14.              End If
  15.         End With
  16.    
  17.     ans = MsgBox("New Deparment entry successfully saved to the record." & vbNewLine & "Do You Want To Add Another Record?", vbYesNo, "Titus School Of Multimedia")
  18.     If ans = vbNo Then
  19.         Unload Me
  20.     End If
  21.    
  22. End If
  23.    
  24. End Sub
  25.  
  26. Private Sub Form_Load()
  27. tbDepartment.Open "Select * from tbdepartment where 1<>1", cn, adOpenDynamic, adLockOptimistic
  28. End Sub