Recent content by Lifeseeker

  1. L

    Open Excel files in subfolders on desktop

    Hi, temp is not recognized as a variable. It should be declared as String type? Thanks
  2. L

    Open Excel files in subfolders on desktop

    Hi there, I have some pieces of code that I am hoping to open a some excel.xlsm files in subfolders within a main folder to do some simple manipulations. file path for the 1st excel file: C:\Users\GJ\Desktop\TEST1\aaa.xlsx file path for the 2nd excel file: C:\Users\GJ\Desktop\TEST2\bbb.xlsx...
  3. L

    Count duplicates only once

    It worked. Thank you. Is my understanding correct? If I don't specify CurrentRec = rs("pt_acct"), then Access will start evaluating the next line at the beginning of the recordset. If I do specify, then it actually starts evaluating on the first record.....? Sounds like I am still confused...
  4. L

    Count duplicates only once

    Hi, This almost works. The first two records are both showing a 0, which based on the logic, it should be 0. However, the first record has to be a 1 regardless. How do I force that? Public Function cohortFinalizer() Dim rs As DAO.Recordset Dim db As Database Dim CurrentRec As String Set...
  5. L

    Count duplicates only once

    I changed to the right column names. Almost there. The loop works and while it seems that it is putting in a "1" only on the last record for each of the same pt_accts, which is fine for my case, the first two records are skipped. I do not know why. [code] Public Function cohortFinalizer() Dim...
  6. L

    Count duplicates only once

    Ok, I have more codes, but it seems to an infinite loop.....what am I missing here? Public Function cohortFinalizer() Dim rs As DAO.Recordset Dim db As Database Dim CurrentRec As String Set db = CurrentDb Set rs = db.OpenRecordset("select test.pt_acct from test order by test.pt_acct")...
  7. L

    Count duplicates only once

    Hi, This is what I have, but I am having trouble completing the loop part. How do you compare only the records where the pt_acct is the same? The code is in the mod. Thanks
  8. L

    Count duplicates only once

    I need this field for filtering in Excel later on. I essentially will need to output this table into Excel and apply conditional formula for subsequent steps, but for now I need to fill the 1s and 0s in this column. Thanks
  9. L

    Count duplicates only once

    Hi, I am trying to loop through a table and count the duplicate records only once. Please see the attached file. 1) In the test table, I want to loop through all pt_accts. 2) In the countable column, if an acct repeats, I essentially just want to put "1" in one of the records. For the...
  10. L

    Update graph's usedrange, VBA

    Thank you. the requirement has just gotten changed, but this is working. Thank you.
  11. L

    Special paste by values, variable not found

    Hi there, I'm trying to paste the values of worksheet 1 by value. Please see the attached two files. When I run the code, it indicates that variable ( xlpastevalues) is not defined. It is not a variable.... can someone help? Private Sub Command0_Click() Dim xlApp As Object...
  12. L

    Update graph's usedrange, VBA

    Can someone help me look into this?
  13. L

    Update graph's usedrange, VBA

    Hi there, I am trying to update the range for the graph automatically and I'm calling this from Access because my data exists in Access. I've attached a sample file. what I am trying to do: 1) click on the button 2) button will update the usedrange in "trending" tab 3) have the graph's data...
  14. L

    Textbox displaying the Min()

    Ah easy fix. Thank you!
  15. L

    Textbox displaying the Min()

    I have actually changed the textbox into combobox, allowing users to select a particular date. How would you write the code if you are using DMIN()? The textbox is not bound to the form. (it says unbounded textbox). How do I get it to bound to the form? Thanks
Back
Top Bottom