Page 1 of 2 12 LastLast
Results 1 to 15 of 22
  1. #1
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228

    MS Access 2010 ErrorCode 2046 Command GoToRecord is currently not available


    This error happens about 10% of the time. I've just lived with it as this part of the database is only accessable by myself. But it would be a good idea to get it sorted if someone has an idea.

    This related to purchase oders and creating invoices.

    The user selects the order from a list. Then presses the invoice button.

    This button does two things: 1. Appends the associalted order number to the invocie entry table (and some other details). 2. Open up the invoice form.

    On form load I have this code: DoCmd.RunCommand acCmdRecordsGoToLast. (this will go to the record that was just appended. so the user can edit some information.)

    As I said earlier this code errors about 10% of the time. When it errors I just close the form and try again.

    Either I need to change or improve this process. Any ideas would be appreciated.

    Andy.

  2. #2
    Minty is offline VIP
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,001
    How are you opening the Invoice form that this error occurs on ?
    Can you you show the code please ?
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    Don't shout, But its in the macro wizard.

    Attachment 38327
    All it does is create a new line that is related to the order > opens the form > the form goes to last record (which is the one ive just added.)

    Thanks,

  4. #4
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    I suspect its due to server issues here. (server performance dropping).

    Rather than typically having a delay in the task. This one seems to just error. Maybe a delay after the form open would help. I can try that and test it.

    Was just reading this: https://social.msdn.microsoft.com/Fo...orum=accessdev

  5. #5
    Minty is offline VIP
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,001
    Your attachment is missing, A query can't open the form, there must be a macro / some code to do that.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  6. #6
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    macro wizard.. its been a long day.

    Attachment should work now.

  7. #7
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Andy,
    Have you looked at the similar threads links at the bottom of the page?

  8. #8
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    yes. me mentioning speed issue was partly to do with this post:

    https://www.accessforums.net/showthread.php?t=49334

  9. #9
    Minty is offline VIP
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,001
    I'm puzzled that you are opening the form to go to a new record, then trying to go to the last one?

    Or have I missed something? Or got the wrong end of the wooden shrub.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  10. #10
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    The new record and the last record are the same record. This record does not exist untill the button "invoice" is pressed. The same button opens the form.

    > create the new invoice record containing only details relating to the order
    > open form
    > go to the record that was just made.

    as always im open to sugestions. This way does work and its the best i could come up with at the time.

  11. #11
    Minty is offline VIP
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,001
    Quote Originally Posted by Homegrownandy View Post
    The new record and the last record are the same record.
    This is incorrect as far as I'm aware, a new record doesn't exist. The last record by definition does.
    This might be part of the problem.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  12. #12
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    Hi Minty its probably more to do with me explaining badly. The New record is created via an append query.

  13. #13
    Minty is offline VIP
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,001
    Quote Originally Posted by Homegrownandy View Post
    Hi Minty its probably more to do with me explaining badly. The New record is created via an append query.
    I'm not sure your description matches the events - earlier you said;
    > create the new invoice record containing only details relating to the order
    > open form
    > go to the record that was just made.

    On that basis the record is created before you open the form. Therefore you should be going to the last record, not a new record.
    IMHO - It would make a lot more sense to get the ID of the record you created with the append query and specifically got to THAT record on form open.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  14. #14
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    I've changed the macro to:

    Code:
    Private Sub Command103_Click()
    
    DoCmd.OpenQuery "New Invoice"
    TWait = Time
    TWait = DateAdd("s", 3, TWait)
    Do Until TNow >= TWait
    TNow = Time
    DoCmd.OpenForm "New Invoice"
    Loop
    End Sub
    The three second wait might prevent a conflict trying to retreve data as it's being written. It's hard to test since it doesnt happen a lot but for now ill stick with this and see how it goes.

  15. #15
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    Minty I agree. Having the form open on that record would be perfect. I'm just unsure how to get/store/use that ID in this situation. Also, sorry for explaining badly.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 12
    Last Post: 05-18-2017, 10:15 AM
  2. Replies: 11
    Last Post: 11-30-2015, 01:06 PM
  3. Access wont follow the command GoToRecord,,acNewRec
    By Stephenson in forum Programming
    Replies: 16
    Last Post: 11-06-2015, 04:14 PM
  4. Replies: 3
    Last Post: 01-02-2015, 02:06 PM
  5. Replies: 4
    Last Post: 12-12-2014, 08:48 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