Results 1 to 2 of 2
  1. #1
    miziri is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    80

    Need counter to print

    Hi,
    I have table with one filed named number.
    and I made form with two field,start and end type number .
    i will put range from 232 to 900 into start and end,i want to copy all number between 232 to 900 inside table field number after press botton on that forms
    see attached file database


    Thanks
    Salih
    Last edited by miziri; 04-18-2011 at 10:02 AM. Reason: make more clear

  2. #2
    khalid's Avatar
    khalid is offline MS-Access Developer
    Windows XP Access 2007
    Join Date
    Mar 2010
    Location
    Kuwait
    Posts
    244
    Dear Salih welcome to the forum!

    First of all remember that field names should not be used as reserved words like number, text, currency etc. it will create errors while using in VBA coding etc.

    you can use the following code to insert the value in your table range from 232 to 900 by clicking a button on your form:

    create a button on your form and on button Click event property put the following code:
    Code:
    Private Sub Command1_Click()
    Dim i As Long
    i = 232
    DoCmd.SetWarnings False
    For i = 232 To 900
        DoCmd.RunSQL "INSERT INTO Table1 (number1) VALUES (" & i & ")"
        i = i + 1
    Next i
    DoCmd.SetWarnings True
    End Sub
    Regards,
    Khalid Afridi

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 0
    Last Post: 02-22-2011, 05:04 AM
  2. Incrementing Counter in Query
    By Rawb in forum Queries
    Replies: 9
    Last Post: 02-10-2011, 02:58 PM
  3. lap Counter
    By challenger in forum Access
    Replies: 4
    Last Post: 07-06-2010, 02:20 PM
  4. Print Preview different from Print Hardcopy
    By peterc in forum Reports
    Replies: 4
    Last Post: 10-27-2009, 05:35 AM
  5. Error when trying to print or print preview
    By TriAdX in forum Reports
    Replies: 8
    Last Post: 08-25-2009, 08:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums