Increment button

jomaxro

New member
Local time
Today, 18:01
Joined
Dec 6, 2011
Messages
6
Hello, I am new to the forums and I have a question.
I am making a sports statistics database. My client requires me to create a live game time data entry method. To do this, I need to list everyone's name, and have buttons next to their names to increment the appropriate field. I have tried
Private Sum Command6_Click()
Me.GP.Value = Nz(Me.GP.Value, 0) + 1
End Sub,
But on click get the error, Run time error '2448' You can't assign a value to this object.
Please note, I am currently in a report, as it was the only way I could think to list all the names.
Please let me know what I am doing wrong.
 
The best advice I will give you is that you should read about what forms and reports are for and how to use them before thinking of embarking on a project.

First of all, a report is simply for displaying records, not for data manipulation. A form is used for data manipulation, so this your first error.

Secondly, the error you are getting is because you have a calculated value in GP or a Control Source that begins with =.
 
could you not just use an update query. im not how to type the criteria in the query for your increment but i have just done this for field x to change from 1 to 2 on the click of a button.
 
Ok, so I successfully have gotten the field to increment, however, when selecting a different game # or opponent, it just overwrites the current value, it does not create a new one. In addition, when I try to query the form, so it only displays the appropriate game # and opponent, it does not list the names at all.
Any help would be appreciated. Attached please find the database.
Josh
PS Form in question is FRM Enter stats, accesed through DFRM Enter Stat, which gives team, game and opponent values.
 
sorry jomaxro, could you please attach the database so i will be able to view it.
 
can you tell me what you are trying to achieve.

on table TBL Game Data. Game# should that be unique?

do you want to be able to select a new game with new opponents and new team. then go to the FRM Enter Stats and use the increment button.

just trying to understand what you are trying to gain
 
So, my goal is to record data for the team in roster, selected in DFRM Enter Stat, then associate each button press with the game # and opponent selected in DFRM enter stat. It is currently doing that, however, when I open the form for the second time and select a new game number and opponent, it continues to increment the same field, and just rewrites the game # and opponent field, instead of adding a new row to TBL Game data.
Does this make any sense?
Let me know.
Josh
 

Users who are viewing this thread

Back
Top Bottom