Results 1 to 12 of 12
  1. #1
    Raveen1609 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Dec 2019
    Posts
    53

    Counter Number and Tab index for form footer

    I am developing a billing application for my small business. I have following couple of issues in Access 2016.

    1. AutoNumber for Invoice ID is not working well, so I have created a field for counting Bill numbers. I use
    Private Sub Form_BeforeInsert(Cancel As Integer)
    BillNo = DMax("BillNo", "Invoice Table") + 1
    End Sub


    On loading the new form new record, I setfocus on Clock1 Field. OnExit the clock1 field, the bill number is adding +1 and it is working fine. Now the problem is when I click goto previous record navigation button, the counter is adding another empty record with the next number and then going back to previous record. Another record is created without datas and only with the BillNumber.

    2. In the sales receipt after selecting and entering the required products in few rows, I need to set focus to the printing command button in the Form footer section, which I am not able figure out. Everytime after completing the receipt, I need to use mouse to click on the button, whereas I need to use tab / Enter Keyboard, for directly going to the cmdPrint button. so that I can use entirely keyboard to complete the invoicing. Avoid using mouse to speed up invoicing.

    Thanks

    Kindly help



    Edit Post Reply Reply With Quote

  2. #2
    Gicu's Avatar
    Gicu is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,112
    Without seeing you db it is almost impossible to give you an answer for the question number 1. As for the second one just set the Default property of the cmdPrint button to Yes and it should act as you want.

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  3. #3
    ssanfu is offline Master of Nothing
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Quote Originally Posted by Raveen1609 View Post
    1. AutoNumber for Invoice ID is not working well,
    Not sure what this means. The autonumber field is not providing a unique number for each record?
    Please explain.....

  4. #4
    Raveen1609 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Dec 2019
    Posts
    53
    The autonumber field is jumping numbers, so not consistent. So I created another field and use dmax function. I have used this function in the BeforeInsert event. When the form is opened, the value is 0. To activate the form, I use the clock1 field to default value of Now() on exit. and set focus to a field in subform.
    Me.[Clock].Value = Now()
    Me![Invoice Details Query1].Form.[ProductName].Enabled = True
    Me![Invoice Details Query1].Form.[ProductName].SetFocus

    All the above are working fine. But the problem is whenever I exit the form to goto previous record another empty record is created automatically with the next number.

  5. #5
    Gicu's Avatar
    Gicu is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,112
    I think that is happening because you are dirtying the form by assigning Now() to a control programmatically. Again, hard to say without seeing your form(s) but I suggest you try to remove the code from the Exit event and set the Default Value for the Clock control to Now() instead.

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  6. #6
    Raveen1609 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Dec 2019
    Posts
    53
    Thanks for your reply. I have attached the sample db. Yes after setting Now() as default value is working ok. But I need another field to setfocus on open to activate form??

  7. #7
    Raveen1609 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Dec 2019
    Posts
    53
    Regarding the setfocus, on the cmdprint command, the default property is set to yes. After entering the datas in the subform, how do I set tab goto the CmdPrint by enter keyboard. It is not moving, do I need to do any programming in subform for the tab to move

  8. #8
    Gicu's Avatar
    Gicu is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,112
    Sorry but I can't see your db anywhere, you may want to attach it again (look at the top of the page for a How To Attach Files button).

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  9. #9
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,778
    Quote Originally Posted by Gicu View Post
    Sorry but I can't see your db anywhere, you may want to attach it again (look at the top of the page for a How To Attach Files button).

    Cheers,
    Added to first post by the look of it.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  10. #10
    Gicu's Avatar
    Gicu is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,112
    But in a different thread all together that I was not even aware of , seems to be exactly the same questions.....
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  11. #11
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,778
    Quote Originally Posted by Gicu View Post
    But in a different thread all together that I was not even aware of , seems to be exactly the same questions.....
    Well I confess that I didn't try any of those 3 links in post 1 but that's what I was referring to. You're saying they are elsewhere and not here, or they are in both? Doesn't matter I guess.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  12. #12
    ssanfu is offline Master of Nothing
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Quote Originally Posted by Raveen1609 View Post
    1. AutoNumber for Invoice ID is not working well,
    The following used to be a page at UtterAccess, but they changed their site and I can't find it anymore.So I'll just paste part of it here:

    Autonumbers--What they are NOT and What They Are
    Please note that I did not write this. The name on the post at UtterAccess is Jinky.

    What they are NOT
    :
    1. Row (record) sequence numbers.
    2. An "order of entry into the table" number
    3. A "gapless" series of numbers.
    4. Editable numbers.
    5. A series of (necessarily) always increasing numbers (see note 1 below in the attached file).
    6. Intended to be viewed/used by end users of the application.
    7. Predictable (as to what the previous or next one in the table is/or will be).
    8. Reassigned, once deleted or discarded (exception: see note 2 below in the attached file).
    9. A predictor/indicator of the number of rows in a table.
    10. Intended to be used to "rank" or "sort" or "number" rows returned from the table (see note 5 below in the attached file).
    11. Necessarily used to determine the default order the rows may be returned from the table (see note 6 below in the attached file).
    12. Indicative of or related to any TimeStamp field that may also be in the table row (see note 7 below in the attached file).

    What they Are:

    1. Unique numbers used to identify individual rows in a table.
    2. Automatically created by Access when a new row is "instanced" by Access (see note 3 below in the attached file).
    3. Great/Outstanding/Essential for use as the Primary Key of a table.
    4. Great/Outstanding/Essential for use as "link points" by Foreign Keys in other tables.
    5. Unchanging, once assigned to a particular table row (exception: see note 4 below in the attached file).


    There is more - but it is quite long, so I attached a text file


    Also check out Microsoft Access Tables: Primary Key Tips and Techniques
    Attached Files Attached Files

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

Similar Threads

  1. Replies: 1
    Last Post: 07-07-2021, 09:10 AM
  2. Replies: 1
    Last Post: 03-14-2019, 01:59 PM
  3. Replies: 27
    Last Post: 12-02-2015, 06:09 PM
  4. Add counter to a form
    By Sonny101 in forum Forms
    Replies: 1
    Last Post: 07-03-2014, 10:54 AM
  5. Need Index Number for FormatConditions
    By newbie in forum Access
    Replies: 3
    Last Post: 01-06-2011, 02:00 PM

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