Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    Perfac's Avatar
    Perfac is offline Expert
    Windows 10 Access 2016
    Join Date
    May 2016
    Location
    Centurion Pretoria
    Posts
    618

    Run-Time Error 3061

    There may be many other errors on this fraction of my app. Please just look at the error I fail to solve so far.
    1. If form f02PrchInvcs is opened, click on Close, the error should appear.
    2. It is about Running Sum and the event under form current. Run-Time Error 3061. I "Googled" and read a bit but no solving yet.
    3. The other form f02SlsInvcs is set up the same and does not return the same error.
    Click image for larger version. 

Name:	230413a.png 
Views:	41 
Size:	15.4 KB 
ID:	50103Click image for larger version. 

Name:	230413b.png 
Views:	43 
Size:	22.2 KB 
ID:	50104
    Attached Files Attached Files

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    Didn't download because basic trouble shooting of your code doesn't seem to have been employed. Always debug.print (don't forget to comment that out when done) your sql when you're testing or trouble shooting. If it looks right, proceed. If it looks right but fails, copy the printout, open a new query in sql view and paste it in. By printing out, your variables should have been replace with real values so pasting into a test query should not be a problem. Switch from sql view to datasheet view, and if it fails, the offending portion might even become highlighted in the sql view.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    Perfac's Avatar
    Perfac is offline Expert
    Windows 10 Access 2016
    Join Date
    May 2016
    Location
    Centurion Pretoria
    Posts
    618
    I found software named "Stellar repair for Access". I ran this little test DB by that software. I normally do the basic trouble shooting (as much as what I learned about basic trouble shooting), but I know in this test there are a few errors, which I am busy with. I hoped it is an easy small fix. Some good man helped me say 5 years ago with the running sum and on my system being used this error does not come up. Thanks for your advice. I will try to comprehend and apply, and let you know.

  4. #4
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    I've also not looked at your example app as I remember finding it difficult to follow on previous occasions.
    Your update query syntax is wrong. It should be something like:

    Code:
    "UPDATE TableName SET FieldName = '" & NewValue & "' WHERE SomeCondition";
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  5. #5
    Perfac's Avatar
    Perfac is offline Expert
    Windows 10 Access 2016
    Join Date
    May 2016
    Location
    Centurion Pretoria
    Posts
    618
    I did note who helped me with running sum some years ago with a FiFo system and it is good, and I saved the exact sample what that person suggested. The code I posted above is exactly like he suggested, and it always worked, including the Update query syntax as you see it. But I am trying new changes to the way I want the Purchase Invoice, and I assume some changes caused this error. Thank you for the code you suggest, but because of my shortcoming's, I probably need spoon feeding or the exact way the code should look on the form.

  6. #6
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    Code:
    UPDATE (SELECT q02PrchsInvcsSub.Coment_IDq, q02PrchsInvcsSub.QuantityA, q02PrchsInvcsSub.PRunTotA FROM q02PrchsInvcsSub ORDER BY q02PrchsInvcsSub.Coment_IDq, q02PrchsInvcsSub.DocumentDateE, q02PrchsInvcsSub.PuinsuID) AS q02PrchsInvcsSubSorted SET q02PrchsInvcsSubSorted.PRunTotA = UpdateRunSum([Coment_IDq],[QuantityA])
    The highlighted E needs to be an X, the name of the field in q02PrchsInvcsSub query is DocumentDateX:
    DocumentDateX: DLookUp("DocumentDateE","q02PrchsInvcs","PurinvID =" & [Purinv_IDa])

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

  7. #7
    Perfac's Avatar
    Perfac is offline Expert
    Windows 10 Access 2016
    Join Date
    May 2016
    Location
    Centurion Pretoria
    Posts
    618
    Thank you. There is another gremlin. I changed the names of fields like DocumentDateX which is now DocumentDateU. Sorry for that, but I guess all of the field names is in correct places now. It seems that you solved the issue of this thread, but I am working on the error below. When I am ready, I will post the small DB again. Earlier today I put in a few hours to transfer form f02PrchsInvcs from my old running system. It took some time because I made many changes over time, but it looks like it is working with the code as it was before your advice. But I am very happy with what you advised and will set it up that way.
    Click image for larger version. 

Name:	230414a.png 
Views:	34 
Size:	97.8 KB 
ID:	50108
    It took me few hours to

  8. #8
    Perfac's Avatar
    Perfac is offline Expert
    Windows 10 Access 2016
    Join Date
    May 2016
    Location
    Centurion Pretoria
    Posts
    618
    You helped me last week with the second Sub form on f02Journals. I first thought I want to add that to f02SlsInvcs and f02PrchsInvcs as well. My thoughts later were that it is best to have that set of sub account system on f02PrchInvcs only. But it is fine, I still have to finish that off.

  9. #9
    Perfac's Avatar
    Perfac is offline Expert
    Windows 10 Access 2016
    Join Date
    May 2016
    Location
    Centurion Pretoria
    Posts
    618
    You could use this information as a test of capturing a purchase invoice. Select anything in the combo boxes, but his may help. Because of what we do about the subset of accounts there is a reason why calculations are now on the form and not in the query. There is a lengthy explanation for that. I am working at it now, we will see.
    Click image for larger version. 

Name:	230414b.png 
Views:	34 
Size:	20.8 KB 
ID:	50109

  10. #10
    Perfac's Avatar
    Perfac is offline Expert
    Windows 10 Access 2016
    Join Date
    May 2016
    Location
    Centurion Pretoria
    Posts
    618
    It's likely that I miss something easy here again. For a moment I thought it was perfect, but my last effort resulted in error. Maybe just open f02PrchsInvcs on the newest post and try to capture the invoice. I don't know why yet, but it does not display the error capturing the first line on the sub form, but it does on the subsequent lines. Thanks.
    Attached Files Attached Files

  11. #11
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    Sorry but I don't see\get errors, what I noticed is that the Sub Ledger Account Name gets reset and only displays for the current record because you are limiting the row source (cascading combo boxes). I have changed that to work OK by resetting the row source in the Enter and Exit events of the combo. For the duplicate error I would suggest you investigated the data in the tables that are part of the record source query as I believe the query (with the recordset set as dynaset inconsistent updates) is attempting the add a record that already exists.
    Note: I had a look and I think the table in question is t09CombinedEntities; you already have a saved record COE0 that you use for the default value, so when the query for the subform adds the record in t02PrchsInvcsSub it will attempt to add a new record in t09CombinedEntities so you get the error. Try to remove this table from the recordsource (q02PrchsInvcsSub) as I don't think you use the fields in the subform, maybe just for some calculations but those could be replaced with dLokkups.

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

  12. #12
    Perfac's Avatar
    Perfac is offline Expert
    Windows 10 Access 2016
    Join Date
    May 2016
    Location
    Centurion Pretoria
    Posts
    618
    Thank you. I was very ill today, slept 20 hours, wanted to call the undertaker, but now I am fine again. I see more errors now. In the test, in t09LedgerAccounts the record for Inventory seems to be deleted. I do not see a saved record COE0 and that it is the default value. I call these documents transaction files. They should not add records to t01CombinedEntities. I will test what you suggest about Dlookups.

  13. #13
    Perfac's Avatar
    Perfac is offline Expert
    Windows 10 Access 2016
    Join Date
    May 2016
    Location
    Centurion Pretoria
    Posts
    618
    Sorry, I looked in t01CombinedEntities, not t09CombinedEntities in the test I posted to you. I see COE0 now and the default. In t09CombinedEntities where I work on that is different no record with COE0??? I don't know how it got there.
    Last edited by Perfac; 04-15-2023 at 09:37 PM.

  14. #14
    Perfac's Avatar
    Perfac is offline Expert
    Windows 10 Access 2016
    Join Date
    May 2016
    Location
    Centurion Pretoria
    Posts
    618
    It is fixed now. You are the best. Thank you.

  15. #15
    Perfac's Avatar
    Perfac is offline Expert
    Windows 10 Access 2016
    Join Date
    May 2016
    Location
    Centurion Pretoria
    Posts
    618
    I am not sure what I did to cause this error. I added "Option Explicit" at the top of the code some time ago, but it always worked since then. Removing "Option explicit" seems to stop the message, but what should I do if it stays. Thank you.
    Click image for larger version. 

Name:	230426a.png 
Views:	10 
Size:	37.5 KB 
ID:	50152

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

Similar Threads

  1. Run Time Error 3061
    By DMT Dave in forum Access
    Replies: 6
    Last Post: 10-22-2019, 08:45 AM
  2. Run Time error 3061
    By sdel_nevo in forum Programming
    Replies: 6
    Last Post: 06-08-2015, 10:09 AM
  3. Run-time error '3061'
    By TheLazyEngineer in forum Programming
    Replies: 1
    Last Post: 03-04-2015, 11:17 AM
  4. Run-Time Error 3061
    By GraeagleBill in forum Programming
    Replies: 2
    Last Post: 09-23-2013, 06:46 AM
  5. Run-time error 3061
    By boywonder in forum Programming
    Replies: 1
    Last Post: 07-20-2011, 06:14 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