Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 17th, 2003, 12:12 PM
bogglebeats bogglebeats is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 24 bogglebeats User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 9 m 57 sec
Reputation Power: 0
problems inserting records

i have made a form called Employee Data which is mainly for calculations of number values. when i open the form, it seems that a record is automatically created. in my other forms, the records start at "0" even though it says record 1 of 1. In the other forms i can press a new record button and the recordset remains to 1 of 1 if it is empty. in this form, i should be able to press a button for new record and that new record should be "1". instead when i press the button for the new record, it jumps to record "2". also, when i scroll through the records, i have to press the < or > buttons twice each to move to the previous or next record. it seems that 2 records are created for each id. (one default and one by user). it's kind of weird so i don't know too much more about it. what is going on??? please help!

ameen

Reply With Quote
  #2  
Old March 17th, 2003, 02:24 PM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed God (5000 - 5499 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 5,163 Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 6 Days 1 h 34 m 20 sec
Reputation Power: 791
you need to show what you are doing in the form code-wise.

Reply With Quote
  #3  
Old March 17th, 2003, 02:31 PM
bogglebeats bogglebeats is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 24 bogglebeats User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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.

Reply With Quote
  #4  
Old March 17th, 2003, 03:51 PM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed God (5000 - 5499 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 5,163 Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 6 Days 1 h 34 m 20 sec
Reputation Power: 791
I can't see right off hand why it is doing this, but I would recommend that you set a breakpoint in your code and walk through it keeping an eye out for what is going on in the back-side of it.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > problems inserting records

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap