A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How do I count records entered in a form



 
 
Thread Tools Display Modes
  #1  
Old September 21st, 2005, 07:41 PM
WrestlingIT
external usenet poster
 
Posts: n/a
Default How do I count records entered in a form

I need to count how many times a button is pushed on an Access form. You see
the data that is entered is very repetative. Many of the records the only
thing that changes is the Primary Key Autonumber, beacuase I am entering in
50 or 60 of the same item. If I can have a couter for how many times I hit
the record Duplicate button it would help greatly.
  #2  
Old September 21st, 2005, 08:16 PM
Douglas J Steele
external usenet poster
 
Posts: n/a
Default

Declare a variable at the module level (i.e.: at the very start of the
module, before any functions or subs), and increment it in the code on the
Duplication button's Click event.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"WrestlingIT" wrote in message
...
I need to count how many times a button is pushed on an Access form. You

see
the data that is entered is very repetative. Many of the records the only
thing that changes is the Primary Key Autonumber, beacuase I am entering

in
50 or 60 of the same item. If I can have a couter for how many times I hit
the record Duplicate button it would help greatly.



  #3  
Old September 21st, 2005, 08:59 PM
WrestlingIT
external usenet poster
 
Posts: n/a
Default

Doug I apperciate the help man, but I dont know how to do VBA code. I am
mostly a hardware/networking guy I know some SQL but most of what you told me
is greek. Is there simpler way, or any chance you can take me though this one
step at a time?

"Douglas J Steele" wrote:

Declare a variable at the module level (i.e.: at the very start of the
module, before any functions or subs), and increment it in the code on the
Duplication button's Click event.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"WrestlingIT" wrote in message
...
I need to count how many times a button is pushed on an Access form. You

see
the data that is entered is very repetative. Many of the records the only
thing that changes is the Primary Key Autonumber, beacuase I am entering

in
50 or 60 of the same item. If I can have a couter for how many times I hit
the record Duplicate button it would help greatly.




  #4  
Old September 22nd, 2005, 11:17 AM
Douglas J Steele
external usenet poster
 
Posts: n/a
Default

Something along the lines of

Option Compare Database
Option Explicit

Private mintDuplicatesMade As Integer

Private Sub cmdDuplicate_Click()

' Code to do the duplicate

mintDuplicatesMade = mintDuplicatesMade + 1
Me.txtDuplicates = mintDuplicatesMade

End Sub

Private Sub cmdReset_Click()

mintDuplicatesMade = 0

End Sub

Private Sub Form_Load()

Call cmdReset_Click

End Sub

This assumes there's a field named txtDuplicates on the form that will show
how many duplicates have been made. It also assumes a Reset button, so that
you can set the value to 0 when you start copying a different record.
(Resetting the counter to 0 can be automated when you move from one record
to another: you'd put code in the form's Current event)


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"WrestlingIT" wrote in message
...
Doug I apperciate the help man, but I dont know how to do VBA code. I am
mostly a hardware/networking guy I know some SQL but most of what you told

me
is greek. Is there simpler way, or any chance you can take me though this

one
step at a time?

"Douglas J Steele" wrote:

Declare a variable at the module level (i.e.: at the very start of the
module, before any functions or subs), and increment it in the code on

the
Duplication button's Click event.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"WrestlingIT" wrote in message
...
I need to count how many times a button is pushed on an Access form.

You
see
the data that is entered is very repetative. Many of the records the

only
thing that changes is the Primary Key Autonumber, beacuase I am

entering
in
50 or 60 of the same item. If I can have a couter for how many times I

hit
the record Duplicate button it would help greatly.






 




Thread Tools
Display Modes

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 Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Count How Many Records on Form? Dave Elliott Using Forms 2 April 26th, 2005 06:01 PM
Need to clear controls of Filter form Jan Il Using Forms 2 November 28th, 2004 02:04 PM
Open another form based on the same records as in the first form Anders Berlin Using Forms 1 September 30th, 2004 09:57 AM
Strange stLinkCriteria behaviour on command button Anthony Dowd Using Forms 3 August 21st, 2004 03:01 AM
Searching Records Melissa Lambino New Users 6 July 20th, 2004 04:51 AM


All times are GMT +1. The time now is 08:10 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.