Question Push Button to increment, will add one to category

dmullins

Registered User.
Local time
Today, 13:08
Joined
Sep 30, 2009
Messages
20
I need to be able to push a button an add 1 to any number field, I may have 10 buttons, but I need it to show a count in the box and everytime you push the button it goes up one.

I am using this to collect times of a particular event that It will total every month and reset to zero. So ineed to be able to get monthly totals to a report and collect the data and store it so Ican present a by month report and total ytd.

The push button is for ease of use, dates need to be fixed so it is not touched but filled in and increments to next day at midnight.

The database counts calls by date, by category - About 15 categories and need to track through the months and keep the information for the reports so you have a every month displayed and YTD totals by category per month and YTD. User will just push a button to count the call, thus adding one to present number in text box, till the end of month, then rest and new month and zero number calls per category.

Anyone feel like helping would be appreciated

Dennis
 
Your post is a bit unclear, but if you are asking how to increment a value in a textbox by one each time a button is clicked, then on the click event of your button you need something like...

YourTextBox.Value = YourTextBox.Value + 1
 
Thanks ,tried it and got an error, "Access can't find the object 'Text84'
 
maybe you could post your database here for us to look at
 
Did you put it in the code builder or right into the event on the proprties tab?
 
Private Sub Command85_Click()
textBox83.Value = textBox83.Value + 1
End Sub

Still get an error box

The expression ON CLick you entered as a event property setting produced the following error: fixd length strings, arrays, user - defined typed and declare statements not allowed as public members of object modules.

Sorry, I wish I knew more, this is frustrating to me, too.

Thanks for your time
 
Okay, cleaned it up and have runtime error '424', Object required
 
Okay, cleaned it up and have runtime error '424', Object required

Try changing this:

textBox83.Value = textBox83.Value + 1


to this:

Me.textBox83.Value = Nz(Me.textBox83.Value,0) + 1
 
Error box "Method or Data Meneber not found' when pushed okay

Debugger highlights in yellow
Private Sub Command85_Click() , which is the button
 
Error box "Method or Data Meneber not found' when pushed okay

Debugger highlights in yellow
Private Sub Command85_Click() , which is the button

Did you actually type in that part or did Access put it there for you?
 
I am copying it into the visual basic window under click

This is a 2003 db, but I am using 2007 access to work on it.

We are converting next year to 2007
 
You might post the database so we can see what is up.
 
Okay I have attached the table in excel format.

It is one table, I know design is everything and three would be better, but can't make it work yet, this works for monthly.
 

Attachments

Okay I have attached the table in excel format.

It is one table, I know design is everything and three would be better, but can't make it work yet, this works for monthly.

Sorry to say that doesn't help a bit as I was more interested in seeing the actual database with the code and try it out to see why it wasn't working, not to see the contents or structure of the table.
 
I attached the form and report in xml.

This is the code for the query on the report, no query on the form:

SELECT qryCount.ID, qryCount.CSO, qryCount.SPA, qryCount.COLLECTIONAGENCY, qryCount.COUNSELINGCONSUMERS, qryCount.COUNSELINGCREDITORS, qryCount.PB, qryCount.RTO, qryCount.MORTGAGEBROKER, qryCount.DDL, qryCount.REFERRED, qryCount.InternetLender, qryCount.MLO, qryCount.SLA, qryCount.SLB, qryCount.Licensing, qryCount.PreciousMetal, [Report Start Date] AS ReportStartDate, [Report End Date] AS ReportEndDate, qryCount.callDate
FROM qryCount
WHERE (((qryCount.callDate) Between [Report Start Date] And [Report End Date]));
 

Attachments

Okay, we must have a communication problem going on, so I'll have to restate it.

Do not post an Excel file, Do not post an XML file.

POST THE ACTUAL DATABASE FILE (the mdb or accdb file).
 
Okay I have attached the table in excel format.

It is one table, I know design is everything and three would be better, but can't make it work yet, this works for monthly.

Hi,

not followed this that much but, if your problem is with the VB code being placed in the database, why post the excel book? it seems your error is your placement of the code in the correct place. i would suspect a simple error thus the code cannot find the object. you either-

1. Place the whole code from your db into a window here and use the correct code wrapper to identify as code ( highlight your code and press the Hash icon above )

2. attach the actual db with any delicate data removed for us to take a look.

im going to assume that you wouldnt be working with real data right now when the db is at its infancy because, that would be silly right?



regs


NS
 

Users who are viewing this thread

Back
Top Bottom