Search results

  1. MajP

    How to query db with memory array data?

    II may have read it wrong focusing on pulling data from the table and the array I was thinking that the array might be a multi dimensional array where it stores the ProductCode and some other information and the table only stores the ProductCode. And you want to join these and pull in other...
  2. MajP

    How to query db with memory array data?

    As far as I can tell the OP is not talking about creating a filter, but joining data So they are likely limited to a temp table.
  3. MajP

    Solved How to Update a recordset without a loop?

    Yes UPDATE your_table SET column_to_update = 'New_value' WHERE id IN ( SELECT TOP 30 id FROM your_table WHERE userFK = 'specific_user_id' ORDER BY ID DESC );
  4. MajP

    Solved How to Update a recordset without a loop?

    It is not reading the PKs of the table it is reading the PKs of the records in the forms recordset. This can be a filtered or queried set of records. Yes it does not update the recordset clone, but it updates all the records contained in the recordset clone. So depending on what you are doing...
  5. MajP

    Solved How to Update a recordset without a loop?

    One more thing. Even without any of these other methods, simply try turning echo off and then back on. Here is the double safe construct with both a transaction and with echo off. My guess is just one of these is good enough. Sub UpdateRecords() Dim db As DAO.Database Dim rs As...
  6. MajP

    Solved How to Update a recordset without a loop?

    Lets say you open a form and the user then applies filters and modifies it. One thing I do often do in that case especially if they have created a complex filter and it is based on a complex query is to figure out the PKs of the records that are still in the form and meet the criteria. Public...
  7. MajP

    Solved How to Update a recordset without a loop?

    I had to ask Chat the pros and cons of a bulk update vs a transaction Here is summary DAO Transactions vs. ADO Batch Updates Feature DAO Transaction ADO Batch Update Purpose Ensures atomicity across multiple operations (insert/update/delete) Allows editing multiple records in memory before...
  8. MajP

    Solved How to Update a recordset without a loop?

    In dao you loop the records then make one change then update the table. In ADO you can loop the records, make all your changes, then update the table. ' Modify records in memory Do Until rs.EOF rs.Fields("Status").Value = "Processed" rs.MoveNext Loop ' Commit all changes at once...
  9. MajP

    Solved How to Update a recordset without a loop?

    dao does not have a batch update but if you create an ADO recordset it does have a batch update. You still have to loop your records to make the updates then updatebatch.
  10. MajP

    Treeview initialize

    Public Function GetItemTreeView() As TreeviewForm 'Set GetItemTreeView = Forms("frmDetail").ItemTreeView (name/object does not exist on form) Set GetItemTreeView = Forms("frmDetail").TVW End Functio
  11. MajP

    Treeview initialize

    In your main form Up top my guess is you declare Private (or Public) TVW as TreeviewForm not as ItemTree. Probably leftover from ItemGenie If it is Public then I can get a reference to an that object (TVW) on the Main form by Forms("frmDetail").TVW If it is declared private then you cannot get...
  12. MajP

    Treeview initialize

    Also is the main form with the tree "FrmDetail"? Check the name.
  13. MajP

    Treeview initialize

    If in your Main Form you dimensioned Private ItemTreeView as TreeviewForm Then this will fail because the ItemTreeView is private and cannot be accessed Set GetItemTreeView = Forms("frmDetail").ItemTreeView You will need to make it public, or you can add a public Get property to the form.
  14. MajP

    How to query db with memory array data?

    If you have an array of 200 item codes Code 1 Code 2 .... Code 200 In what way could you combine this? Are you wanting to join or Union the data. If you did a join that would not help because you would already have to have the code in the real table. You can add a column to a disconnected...
  15. MajP

    Trying to wrap my brain around table normalization in a 1:many relationship

    Also Curios what the real problem is because for these "assignment" type databases you might want a slicker UI. You could do a treeview where you can drag or move things from one node to another or you can do multiple listboxes where you can assign reassign. Any design needs the ability to...
  16. MajP

    Trying to wrap my brain around table normalization in a 1:many relationship

    @cricketbird, This is another approach for your assignment problem and may be cleaner. Than the subform. The challenge doing this as a main form with a subform is that in this design you want to see who is assigned to the current record, who is assigned somewhere else, and who is not assigned...
  17. MajP

    Solved conditional formatting duplicates

    My point is that there are many queries that you can use to return the duplicates. Most of these require a subquery or aggregate query which makes the whole query not updateable and thus make your form not updateable. Therefore, if you need your form updateable, use the first technique with a...
  18. MajP

    Solved conditional formatting duplicates

    If you notice the one using the Dcount is editable. The second uses an aggregate query which makes it non updateable. If you need to update the form then the dcount is the easiest.
  19. MajP

    Solved conditional formatting duplicates

    See if this example helps. One uses the Dcount. The other query uses an aggregate query to get the counts.
  20. MajP

    Solved conditional formatting duplicates

    OK. Then I would look at some version of what @DHookom suggests. You can then format where count is > 1.
Back
Top Bottom