Search results

  1. MarkK

    Should we make The_Doc_Man a Super Moderator?

    Despite the lingering horror of post #7, I voted yes. Congrats @The_Doc_Man!!!
  2. MarkK

    Closing Form Instances

    I think so. • It's fire-and-forget, and simpler than maintaining an external reference list to manage lifetimes and instances. The object itself becomes the single-source-of-truth regarding how and when it goes out of scope. • And you can enable the Form's built-in close button because you...
  3. MarkK

    Should we make The_Doc_Man a Super Moderator?

    Jon: Can you briefly describe what difference it makes? Thanks, Mark
  4. MarkK

    Closing Form Instances

    Maybe there's a misunderstanding. This is the only way I open non-default instances, and I never actually call the CloseMe method, I just close the form using the close button. This frees me up from having manage instances externally. Because the form is a circular reference memory leak, it...
  5. MarkK

    Closing Form Instances

    You should also be able to create a non-default instance of a form that reference-counts itself to stay open, like... Private me_ As Form Private Sub Form_Open(Cancel As Integer) set me_ = Me End Sub Public Sub CloseMe() Set me_ = nothing End Sub ... which frees up your consumers from...
  6. MarkK

    Inconsequential Query

    Recently I've been querying data over http from SharePoint. Lists exposed on SharePoint are available via phone-based MS Power Apps for users who have an account on our company MS 365 tenant account. For outward-facing data domains this is really cool, because our Access-based ERP system can...
  7. MarkK

    Solved Appending records into history table of changes made to customer info

    Without claiming this is the best way... Private isNew_ As Boolean Private Sub Form_Current() isNew_ = Me.NewRecord End Sub Private Sub Form_AfterUpdate() If isNew_ Then Exit Sub .... End Sub
  8. MarkK

    VBA not working for saved query parameters

    You can also lean up your code like... Sub YourCode_Simplified() ShowData GetRecordset End Sub Private Function GetRecordset() As DAO.Recordset With CurrentDb.QueryDefs("qry_Par_Start_Date_In_Range") .Parameters("[parExamFreq]") = "Weekly" .Parameters("[parExamPeriod]")...
  9. MarkK

    Form with subform in transaction

    You might also implement a concept like RowState. Add a field with that name to any table and you have complete control regardless of what Access does. When the user clicks Save, modify RowState as required. Then you can make your own rules, like if a child row is committed, commit the parent...
  10. MarkK

    Output data from tables into a directory or phonebook

    Another data structure to consider is to insert a role object between the group and the individual. tGroup GroupID GroupName IsHousehold IsWorshipTeam IsNursery IsGreeter IsAdmin tRole RoleID GroupID PersonID RoleName StartDate EndDate tPerson PersonID Firstname Lastname A Household is just...
  11. MarkK

    Output data from tables into a directory or phonebook

    Are you talking about needing a hierarchical view? Like, do you want something like... Doe John Jane Bambi Smith Metal Gold Aero If so, look into grouping data in a report. You write a query that returns... Doe, John Doe, Jane Doe, Bambi Smith, Metal Smith, Gold Smith...
  12. MarkK

    ow to print a tree view

    Me.Controls("TreeReqs") is an Access.CustomControl object that only hosts the Treeview. Use its .Object property to expose the Treeview inside it, like... Private Sub PrntForm_Click() GetTreeViewText Me.TreeReqs.Object End Sub
  13. MarkK

    Field has no value

    I'd keep routines like this somehow within scope when you work with treeviews... Function GetNodeByKey(Key As String, Nodes As MSComctlLib.Nodes) As MSComctlLib.Node On Error Resume Next Set GetNodeByKey = Nodes(Key) End Function Sub SelectNode(nd As MSComctlLib.Node) If nd Is Nothing...
  14. MarkK

    Currency from US$ to GBP

    It's not clear what this means. • Maybe you need to do a currency conversion from US$ to GBP at the current conversion rate? • Maybe the currency symbol can just be changed in Windows regional settings? • Maybe your textboxes have a custom TextBox.Format property value that explicitly uses the...
  15. MarkK

    Pat Hartman has left the building

    Jon, I think this is a garbage call on your part. To me, if someone chooses to participate in a community, the contribution they freely make belongs to the community. I think it does a dishonour to the rest of us that rather than protect the quality and integrity of the threads we all...
  16. MarkK

    Hello from Canada!

    Hey Albert. Mark here, just 11 hours away by car, outside of Vancouver. Welcome!
  17. MarkK

    Creating a simple command line console app in Visual Studio 2019

    A little while a go I wrote a VB.Net console app to generate QR code .png files from data. I can just pass in the payload and filename, and it integrates seamlessly into the MS Access project. I even found a way to force it to run synchronously so I can call if from Report.Detail_Format()...
  18. MarkK

    How to ignore a mod?

    Pat I have reported your post with this note:
  19. MarkK

    Matching vba recordset to form recordset

    I wouldn't reach down into a child object, pull out its data source, apply a bunch of logic, and then stuff that data source back into the child... Rather, the child object should expose a method, like... Forms!frmDetail!ItemDetail.Form.AddItem ID, Path The object that owns the data should also...
  20. MarkK

    Recordset field not readable after update

    When adding a row to recordset, grab the new ID after an edit, but before the update... Dim newRowID As Long With CurrentDb.OpenRecordset("SELECT RowID, SomeField FROM Table1") .AddNew !SomeField = "Updated" newRowID = !RowID .Update End With
Back
Top Bottom