vba
16 TopicsInconsistent 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 Pro382Views0likes5CommentsVBA: 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: 661210459Views0likes2CommentsAccess 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.3KViews0likes11CommentsConnecting MS Access to MS Outlook Calendar - MS Outlook calendar to automatically generate event
In short, I am building a holiday planner, which all the employees within my department are to use. I want to build such functionality in MS Access that, whenever I have approved a holiday, i.e. the approved time period goes into table X, Columns Y and Z, which columns are date columns. I want to extract the time period columns Y and Z form and automatically generate an event in the MS Outlook calendar, which states the employee name from the employee table and the time period they are to be absent. For this I need MS Outlook to extract the data from MS Access. Do you guys have a suggestion how this may happen? P.s. Also I want the calendar I made in MS Outlook to check the table once every 24h and for every new row in table X I want it to create a new event automatically and delete the relevent event if the row is delete1.2KViews0likes1CommentAppcrash Access / VBA
Hi, I am part of a development team that has an application written in access / vba (access runtime 2000) in production and without installing any updates on some machines, with the Windows 10/11 operating system, the program no longer starts. Searching the internet, we found this article: https://learn.microsoft.com/en-gb/DeployOffice/security/internet-macros-blocked#use-policies-to-manage-how-office-handles-macros Could the problem be related to this update? We tried following the guidelines to get it back up and running but couldn't fix it. Has anyone faced and solved any similar problem? Thanks for any help. --- Salve, faccio parte di un team di sviluppo che ha in produzione un'applicazione scritta in access / vba (access runtime 2000) e senza l'installazione di nessun aggiornamento su alcune macchine, con sistema operativo Windows 10/11, il programma non parte piĆ¹. Eseguendo delle ricerche su internet abbiamo trovato questo articolo: https://learn.microsoft.com/en-gb/DeployOffice/security/internet-macros-blocked#use-policies-to-manage-how-office-handles-macros Il problema potrebbe essere collegato a questo aggiornamento? Abbiamo provato ad seguire le linee guida per ripristinare il funzionamento ma non siamo riusciti a risolvere. Qualcuno ha affrontato e risolto qualche problema simile? Grazie per un eventuale aiuto.2.5KViews0likes13CommentsVBA Modules Access no longer available
Hi everyone, I have (maybe: i had) a file access with more VBA modules inside. The file is stored into a OneDrive's location. After a couple of moths I've opening the files to continue the programming activities and I've got a surprice. All modules are not longer available. I see it in the panel but whe I try to open it I've a message: The module name is wrong or it refers to a nonexistant module. I contacted Microsoft support and I discovered a huge truth: There was never support for Microsoft Access. Is there someone that had same problem and fixed it ?2.5KViews0likes5CommentsSharepoint list update is not working sometimes
Hello all, I have a sharepint list, and updating the list using access vba. I have a problem sometime the update works and sometimes it doesnot works, i have been trying to solve this problem using different commands likeCurrentDb.TableDefs("shp_table").RefreshLink but unfortunately its not working. I am using a loop with maybe 5 recordsets, sometime 4 gets updated, sometimes 5 my update command is right. Do you have some possible solution for this? many thanks in Advance BR ArslanSolved7.2KViews0likes31CommentsRating system problem
To start out with, this form is used to rate things using a five-star method. I have a combo box that a user can select a category on which they wish to rate the transaction on. Once they select one and decide to add it, I have VBA that adds that selected category to the database and requeries a subform. The subform is linked to the overall record. The entry is listed in the subform and has 5 empty stars and the user can click on the star and it, as well as the previous stars, get replaced with a filled star. The images are merely placeholders and the actual rating, 1 to 5, is stored as an integer. Everything works to this point. My issue is, when the user tries to select a star, all the ratings for all the other categories are also mirrored. I am sure it is something very simple I am overlooking but I just can't put my finger on the issue. As the 5 placeholders are individually named but duplicated for each record, my code does not know specifically which entry it should stick to. Can anyone help me on this; point me to a tutorial online or help anything to help rattle my brain My continuous form looks like : This is subform in the actual form with the Rating category combobox. The Overall Rating works like it should. Any help and guidance is greatly appriciated516Views0likes0CommentsUnbound Text box Value to strPathFile variant in Access using Visual basic.
Iaminneedofsomehelp.Iamtryingtoimportanexcelbook,withdifferentsheetsintoAccess.TheproblemIamhavingiscopyingthelinkfromtheTextfilenametomodule1sothatit issomewhatautomated.Forthelifeofme,Ican'tfigureitout.Ithinkit isnotreallywrittento thetextboxis theproblem,butnotsure.Anyhelpwouldbeappreciated! Thanks Mike PublicSubImport_File(FilenameAsString,tablenameAsString) DimblnHasFieldNamesAsBoolean,blnEXCELAsBoolean,blnReadOnlyAsBoolean DimlngCountAsLong DimobjExcelAsObject,objWorkbookAsObject DimcolWorksheetsAsCollection Dim Item As Variant DimstrPasswordAsString DimstrPathFileAsVariant 'EstablishanEXCELapplicationobject OnErrorResumeNext SetobjExcel=GetObject(,"Excel.Application") IfErr.Number<>0Then SetobjExcel=CreateObject("Excel.Application") blnEXCEL=True End If Err.Clear On Error GoTo 0 'ChangethisnextlinetoTrueifthefirstrowinEXCELworksheet ' has field names blnHasFieldNames=True 'ReplaceC:\Filename.xlswiththeactualpathandfilename strPathFile = File 'Replacepasswordtextwiththerealpassword; 'ifthereisnopassword,replaceitwithvbNullStringconstant '(e.g.,strPassword=vbNullString) strPassword=vbNullString blnReadOnly=True'openEXCELfileinread-onlymode 'OpentheEXCELfileandreadtheworksheetnamesintoacollection SetcolWorksheets=NewCollection SetobjWorkbook=objExcel.Workbooks.Open(strPathFile,,blnReadOnly,,_ strPassword) ForlngCount=1ToobjWorkbook.Worksheets.Count colWorksheets.AddobjWorkbook.Worksheets(lngCount).Name Next lngCount 'ClosetheEXCELfilewithoutsavingthefile,andcleanuptheEXCELobjects objWorkbook.CloseFalse SetobjWorkbook=Nothing IfblnEXCEL=TrueThenobjExcel.Quit SetobjExcel=Nothing 'Importthedatafromeachworksheetintoaseparatetable ForlngCount=colWorksheets.CountTo1Step-1 DoCmd.TransferSpreadsheetacImport,acSpreadsheetTypeExcel9,_ "tbl"&colWorksheets(lngCount),strPathFile,blnHasFieldNames,_ colWorksheets(lngCount)&"$" Next lngCount 'Deletethecollection SetcolWorksheets=Nothing 'Uncommentoutthenextcodestepifyouwanttodeletethe 'EXCELfileafterit'sbeenimported ' Kill strPathFile End Sub PublicSubbntBrowse_Click() DimdiagAsOffice.FileDialog DimItemAsVariant DimFileAsVariant Setdiag=Application.FileDialog(msoFileDialogFilePicker) diag.AllowMultiSelect=False diag.Title="Pleaseselectaexcelspreadsheet" diag.Filters.Clear diag.Filters.Add"ExcelSpreadsheets","*.xls,*.xlsx" Ifdiag.ShowThen ForEachItemIndiag.SelectedItems Me.txtFileName=Item Next End If End Sub PublicSubbntImportSpreadsheet_Click() DimFSOAsNewFileSystemObject DimFileAsVariant IfNz(Me.txtFileName,"")=""Then MsgBox"Pleaseselectafile!" Exit Sub End If IfFSO.FileExists(Nz(Me.txtFileName,""))Then Module1.Import_FileMe.txtFileName,FSO.GetFileName(Me.txtFileName) Else MsgBox"FileNotfound" End If950Views0likes2Comments