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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|
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 |