vba
76 TopicsAccess fixes released in Version 2410
Initial release Version 2410 (Build 18129.20116). Bug Name Issue Fixed Memory leak when using the Properties collection in VBA code Every time there was a reference to the Properties collection (e.g. obj.Properties("Text")) in VBA code, Access would leak memory. If this was done a large number of times, the memory usage of Access could increase significantly. Please continue to let us know if this is helpful and share any feedback you have.473Views2likes0CommentsInconsistent Results Referencing Nested Subreport Property
I have placed several subreports in an unbound report's Report Header. Each subreport has two subreports. I'm trying to get the value of the Top property of the first of these sub-subreports, but I'm getting inconsistent results. The reference I'm (currently) using in the OnLoad event of the main report is: intSubSubTop = Me.Controls(strSub1).Report.Controls(strSubSub1).Top This works perfectly when I switch from Design View to Print View, but I get a runtime error (2455: the expression "has an invalid reference to the property Form/Report") when I open the report from the navigation pane. What's the difference between these two actions? I've tried different variations to no avail. What do I need to do to make it work consistently? I'm using Access 2010 on Windows 10 Pro382Views0likes5CommentsWhat does the "sourcedoc" part of a SharePoint filepath represent?
Hi all, I've been working on opening sharepoint files with VBA (reference PowerPoint decks via a ribbon button). I'm using "Application.ActivePresentation.FollowHyperlink SharePointPath" which is working fine. The constant SharePointPath is the direct SharePoint link for the files I want, which takes this form: https://tenant.sharepoint.com/:p:/r/sites/sitecollection/_layouts/15/Doc.aspx?sourcedoc=%7BB60C7EC5-A285-4BC7-9B0B-B98A148A26D7%7D&file=filename.pptx I've been testing different combinations of replacing the file in place, changing the filename, etc. to see how this can be broken and have noticed a strange behaviour. When I: - Uploaded a different file to the same folder - Deleted the original file - Renamed the new file to the filename of the old file I got a different "sourcedoc" (the bit in blue), however, the original link still worked. To play out the example: - I uploaded a file, which had this path https://tenant.sharepoint.com/:p:/r/sites/sitecollection/_layouts/15/Doc.aspx?sourcedoc=xxxxxx&file=originalfilename.pptx (this path was put in the constant "SharePointPath" in VBA) - I uploaded a new file, which had this path https://tenant.sharepoint.com/:p:/r/sites/sitecollection/_layouts/15/Doc.aspx?sourcedoc=yyyyyy&file=newfilename.pptx - I renamed the new file to the filename of the original file, which then had this path https://tenant.sharepoint.com/:p:/r/sites/sitecollection/_layouts/15/Doc.aspx?sourcedoc=yyyyyy&file=originalfilename.pptx - Then tried"Application.ActivePresentation.FollowHyperlink SharePointPath" WITHOUT updatingSharePointPath (so the path was the xxxxxx path) and it still successfully opened the new file. So my question is, what is that "sourcedoc" reference? What does it represent and why didn't it matter that I changed it? I have seen it is a "document_GUID" but not clear on how it works why it didn't matter that it changed7.1KViews2likes2CommentsVBA: DoCmd.RunCommand acCmdCopy not working
I have a Rich Text Formatted Access field on a subform that I need to copy to the clipboard. Because Writeline doesn't have a FormattedText option, I can't simply write the field to the clipboard. Doing that copies it with the code and unformatted text. So instead, I'm trying to useDoCmd.RunCommand acCmdCopy Here's the code: 'set focus on subform Me![Case Attachments subform].SetFocus 'go to the last record on the subform DoCmd.GoToRecord , , acLast 'Copy the Field value DoCmd.RunCommand acCmdCopy The copy isn't working. The clipboard is empty. Interestingly, when I add a debug test right before the acCmdCopy: Dim tryit As String tryit = Me![Case Attachments subform].Form![Doc Description].Text MsgBox (tryit) it shows me that tryit equals the text I need to copy. I.e., I have the right field selected in its entirety. Anyone have any suggestions on how to get it to work or alternatives to copy the rich text to the clipboard so it can be paste correctly. (And, before you offer, NO, I don't want to write VBA code to jump over to Word, create a new file, paste it there, copy it, and delete the Word file).2.7KViews0likes5CommentsAccess Europe Meeting - Wed 7 Feb
The next Access Europe meeting will be onWednesday 7 Feb 2024starting at18:00 UK time(6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE add-in MZ-Tools,Carlos Quintero,will be leading a presentation calledTop 10 advanced features of MZ-Tools For more details about the topic and speaker together with connection details for the meeting, please visithttps://isladogs.co.uk/aeu-24/orhttps://accessusergroups.org/europe/event/access-europe-2024-02-07/ During the session, a free copy of MZ-Tools will be given away to one person attending the session. Be there (or be square...)! For local times, please checkhttps://www.worldtimebuddy.com/ The meeting will again be held on Zoom. When the time comes, you can connect usingJoin Zoom Meeting. If you are asked, use: Meeting ID: 924 3129 5683 ; Passcode: 661210459Views0likes2CommentsTable cell value from VBA
Hello, I have a question. When I get the value of a cell from a table in Word, it always brings it with an unknown character. If we activate "Show All" we see that there is a respective symbol for each cell, although each part of a document has its own symbol, like space, section break, page break, paragraph, etc. In fact, I get, for the example of this post, the value of a paragraph and it gives it to me clean, without any character. So, I don't understand what is that character that brings the value of the cell, do you know what is that character and do you know what other way there is to extract the value cleaner without that character? I show you in the screenshot the solution I gave to this problem (it is as a comment), but I would like to know if you have another way to solve this issue.Solved1KViews0likes2CommentsAccess 2019 - List Box.Requery event on Main Form causes Sub Form Current event to trigger
I have a simple Main Form with one SubForm. On the Main Form I have a ListBox called "listItems" whose RowSource is set to a Query. If I issue a listItems.Requery, the Current event of the SubForm is triggered. Why is this happening? And is it possible to prevent the SubForm current event from triggering?3.3KViews0likes11CommentsUpdate Taskdescription via VBA - Error -2147483638 - the data required for this operation are not ye
Hello! I develop an integration of planner tasks into an internal access database and there I will create a task with a important description. The creation works fine, but when I update the taskdetails and there the description I get the error-2147483638 - the data required for this operation are not yet. If I go stepwise through the code all works fine, but not in processing my whole code. I think that the task descriptions is not accessible that early so I have to put my code to sleep, just I can't find anything about "How long do I have to put my code to sleep?" or exists any other reason for that? Update: First I have set Sleep 10000 for 10 seconds pause of the code and second here a screenshot in german with the error message, because the 10 seconds don't helps. My VBA-Code to Update is the following. This function is a part of my class "Teams" Public Function UpdateTaskDescription(pstr_ID As String, pstr_Description As String) As Boolean On Error GoTo Err_UpdateTaskDescription Dim GraphAPI As New MSXML2.XMLHTTP60 Dim str_URL As String Dim str_Body As String Dim str_ETag As String Dim JSON As Object str_URL = "https://graph.microsoft.com/v1.0/planner/tasks/" & pstr_ID & "/details" wiederholung: str_ETag = GetETagByDetails(pstr_ID) With GraphAPI .Open "PATCH", str_URL, True .setRequestHeader "Content-Type", "application/json" .setRequestHeader "Authorization", GetAuthentication '.setRequestHeader "Prefer", "return=representation" Kann mit angegeben werden, wenn das gesamte Objekt zurückkommen soll. So kommt nur 204 - No content => success .setRequestHeader "If-Match", str_ETag str_Body = "{" & vbNewLine str_Body = str_Body & Chr(34) & "description" & Chr(34) & " : " & Chr(34) & pstr_Description & Chr(34) & vbNewLine str_Body = str_Body & "}" .Send str_Body End With UpdateTaskDescription = GraphAPI.Status Err_UpdateTaskDescription: If Err.Number = -2147483638 Then GraphAPI.abort GoTo wiederholung Else MsgBox Err.Number & " > " & Err.Description End If End Function Thanks in advance. AxelSolved811Views0likes2CommentsVBA code to bring the active document in front
I have a subroutine that produces and edits six different documents. My current problem is that the documents all stay in the background. But, I want them to be in front of all other windows using only VBA and without APIs. I've looked for code to do that and they either use APIs or create a new document. I tried this code: Sub Generate_Motion() Call Initiations Documents.Add Template:=pathInputDoc & "\Template.dotx" Dim wdApp As word.Application Dim word As word.Document Set wdApp = GetObject(ActiveDocument, "Word.Application") wdApp.Visible = True With ActiveDocument ... End Sub but it gives me an error. Is there way to bring an already-open document in front using only VBA code?5KViews0likes3Comments