Need some help

I am new to this so please understand.  What I am trying to do is have 10 text boxes and those text boxes have a database field.  I want to enter a number for each box once the 10th box is entered I want to have it start back on the 1st box but not get rid of the other 9 boxes with the numbers in them.  I can replace the 1st box.  I'm trying to get an avg. over a 10 week period of how many hours a person works and I would put there hours in each week.  I hope this makes sense.
discgolfamAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GeorgeKCommented:
Sorry,
  Your discription is a little difficult to follow. Are your text boxes bound to fields in the database? What data is it that your storing in the text boxes? Hours? Why do you mean by start back on the 1st box but not get rid of the other boxes? do you want to display the tenth record into the 1st text box? How do you know whose hours the text boxes relate to when entering the hours or are you just summing hours and adding the separate hour values to the database?
0
discgolfamAuthor Commented:
Sorry about how difficult it is to follow.  Yes the text boxes are bound to fields in the database.  I just want to store numbers, which are the employees hours for the week.  I don't want to keep track of more than 10 weeks worth of hours.  I need to get an avg. of how many hours the employee works over a 10 week period.  These hours are entered by hand each week.  I hope this helps.
0
MattiCommented:
Hi!

If I get this right you are doing
a front end to DB and need to addnew
record when user fils it and press Enter in the last field?

Private Sub Text10_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Data1.Recordset.AddNew
DoEvents
Text10.Text = ""
Text9.Text = ""
Text8.Text = ""
Text7.Text = ""
Text6.Text = ""
Text5.Text = ""
Text4.Text = ""
Text3.Text = ""
Text2.Text = ""
Text1.Text = ""
Text1.SetFocus
End If
End Sub


If you need to auto insert someting if must be done like text = "string here"

I also asyme you did bind those textboxes using a datacontrol, correct?

That binding might create update problem
if you set some text boxes by code, it need to handle, this sample ADDNEW first
then touches to text values.

Also much better performance and programming style is use here a loop, but you must use a control array whit those textboxes first, might need just renane them.

Dim i&
For i = 0 to 9
textbox(i).text = ""
Next i
 
Matti
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.