
March 17th, 2003, 02:31 PM
|
|
Registered User
|
|
Join Date: Feb 2003
Posts: 24
Time spent in forums: 1 h 9 m 57 sec
Reputation Power: 0
|
|
|
well i am letting the access default handle what happens when a form loads. all of my other forms work, but in this particular one, a record gets created when the form loads. that is why when i try to add a record when nothing is populating the recordset it jumps to record #2 instead of going to record one. the other forms i can go to record #1 when i click on an add record button that i created. i have nothing in the form load property either. also when i try to delete an entry, new records get created. when i select records new records get created also. here is the code for the form:
cheers!
Option Compare Database
Private Sub Add_Quarter_Click()
On Error GoTo Err_Add_Quarter_Click
Dim valquarter As Integer
valquarter = New_Total.Value
If CurrentRecord <= "3" Then
DoCmd.GoToRecord , , acNewRec
Quarter.Value = CurrentRecord
Last_Quarter_Total = valquarter
Else
MsgBox "Only 4 Quarters in a Year!"
End If
If CurrentRecord = "1" Then
Month.Value = "Jan-March"
End If
If CurrentRecord = "2" Then
Month.Value = "Apr-Jun"
End If
If CurrentRecord = "3" Then
Month.Value = "Jul-Sep"
End If
If CurrentRecord = "4" Then
Month.Value = "Oct-Dec"
End If
Exit_Add_Quarter_Click:
Exit Sub
Err_Add_Quarter_Click:
MsgBox Err.Description
Resume Exit_Add_Quarter_Click
End Sub
Private Sub Last_Quarter_Total_LostFocus()
Total_Quarter.Value = (Last_Quarter_Total.Value + New_Quarter.Value)
New_Total.Value = (Total_Quarter.Value - Left_Quarter.Value)
End Sub
Private Sub Left_Quarter_LostFocus()
New_Total.Value = (Total_Quarter.Value - Left_Quarter.Value)
End Sub
Private Sub New_Quarter_LostFocus()
Total_Quarter.Value = (Last_Quarter_Total.Value + New_Quarter.Value)
New_Total.Value = (Total_Quarter.Value - Left_Quarter.Value)
Total_Race.Value = New_Quarter.Value
Total_Age.Value = New_Quarter.Value
Total_Gender.Value = New_Quarter.Value
End Sub
Private Sub Previous_Quarter_Click()
On Error GoTo Err_Previous_Quarter_Click
DoCmd.GoToRecord , , acPrevious
Exit_Previous_Quarter_Click:
Exit Sub
Err_Previous_Quarter_Click:
MsgBox Err.Description
Resume Exit_Previous_Quarter_Click
End Sub
Private Sub Next_Quarter_Click()
On Error GoTo Err_Next_Quarter_Click
DoCmd.GoToRecord , , acNext
Exit_Next_Quarter_Click:
Exit Sub
Err_Next_Quarter_Click:
MsgBox Err.Description
Resume Exit_Next_Quarter_Click
End Sub
Private Sub delete_quarter_Click()
On Error GoTo Err_delete_quarter_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
Exit_delete_quarter_Click:
Exit Sub
Err_delete_quarter_Click:
MsgBox Err.Description
Resume Exit_delete_quarter_Click
End Sub
Last edited by bogglebeats : March 17th, 2003 at 02:49 PM.
|