Search results

  1. 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...
  2. 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...
  3. 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...
  4. 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...
  5. L

    Textbox displaying the Min()

    Hi guys, I have a blank form, and it has two textboxes which are meant to show 1) from date 2) thru date in the control source of my first textbox, I put in.... =Min([TEST].[Dates]) but I'm getting ERROR in that textbox. Basically I want to just find the smallest date in the column...
  6. L

    converting from mm/dd/yyyy to dd/mm/yyyy

    hi there, I am doing this in query grid: CDate(Format([test].[RefReferredOn],"dd/mm/yyyy")) In table test, the refreferredon is already a date/time format (in mm/dd/yyyy) When I run this query in Access, I still get the dates in mm/dd/yyyy format. What is the next step to get it in...
  7. L

    Import csv into Access, 2391 error

    Hi there, I'm simply trying to import a csv file into Access regularly using this code Sub Command0_Click() 'import from text file DoCmd.TransferText acImportDelim, , "test", "M:\testR.csv", "-1" End Sub The error I'm getting is attached in the word doc. I have no idea what that weird...
  8. L

    Compare admission date to previous discharge date, VBA

    Hi, I have attached a sample database. Basically I want to have some lines of code that generate the result table, which is tbl_readmit_result. As you can see, the difference is the addition of a new column called re_admit_status. Rule is: Status = "y" when the admission date, compared to...
  9. L

    Access 2010 write to Excel 2013, application defined or object defined error 50290

    Hi there, I have an access application that writes data to Excel 2013. I have tested it on both Access 2010 to Excel 2010, and it worked, but not when I switch to Excel 2013. Is there a way to have Access 2010 open Excel 2010 instead of 2013?? This is the code in Access 2010 Dim xlApp As...
  10. L

    form-based parameters, paste output to Excel - "too few parameters"

    Hi there, What I would like to do: 1) have users fill in dates in this form in Access. 2) click on a button which takes the parameters and feed into a query 3) have access extract the output of the query into an excel file. Issues I'm getting is that when I run the code, Access keeps saying...
  11. L

    wildcard like, not returning desired output

    Hi, I'm building a query using wildcard "like". See the attached file. My question is that why doesn't the query "result" return "aaaaa" for "aaa" is contained within "aaaaa"? I'm basically limiting my records to those found in tbl_site based on a wildcard "like". Any help is much...
  12. L

    VBA to check if workbooks are open - error

    Hi there, I have a set of code that helps me check whether or not excel workbooks are open. I'm actually running the code in access. Public Sub workbookopen() 'code to check if 4 sites are open Dim location_Central As String Dim location_East As String Dim location_North As String Dim...
  13. L

    Bolding column headers after exporting from Access into Excel

    Hi there, I would like to export from access a recordset into Excel and bold the column headers. My current code works for the most part, except for the bolding. Could anyone take a look at it? You run the code in Access module and the code does the following: 1) checks to see if the excel...
  14. L

    Open excel workbook from Access, clear cell contents

    Hi there, I would like to open an Excel workbook from MS Access and clear cell contents, or just delete some records in a specific worksheet. If you open the test workbook, cell contents in RAW need to be deleted by calling from Access. I have produced some code but it's partially working...
  15. L

    Functions return #ERROR, null values

    Hi, I have following code: Option Compare Database Option Explicit Public Function AssignWeeklyDisch(DischargeDate As Date) As Integer 'starts assigning weeklys If DischargeDate.Value = "" Then AssignWeeklyDisch = 100 End If If DischargeDate >= #4/1/2012# And DischargeDate < #4/8/2012# Then...
  16. L

    External name not defined error

    Hi there, I have a table onto which i would like to add new column based on a set of if statements. (to assign weekly dates) this is only a portion of the code, but when I clicked on run, it gives me "external name not defined error". Option Compare Database Option Explicit Public Sub...
  17. L

    Like operator, include fractions in result

    Hi there, I have the following query, which I simplied to show only the WHERE clouse. WHERE ((([Using our own appt date].PrblDiagCode) Like "519" Or ([Using our own appt date].PrblDiagCode)="414" Or ([Using our own appt date].PrblDiagCode)="428" Or ([Using our own appt...
  18. L

    rounding an average values

    Hi there, I'm trying to get this query to work: SELECT Avg(Round([Final 205].[LastOfSumOfRehLOS],2)) AS AvgInpLOS, Avg(Round([LastOfSumOfWaitLOS],1)) AS AvgWaitTime, Count([Final 205].PHN) AS Observations, [Final 205].LastOfIntensity AS Intensity_Level FROM [Final 205] GROUP BY [Final...
  19. L

    iifs query returns -1

    Hi there, I am writing some iif conditional statements in one of my tables to assign new values in that table. FP: IIf([cohort with status].[Intake Date] Between #04/01/2012# And #26/04/2012#,201201) Or IIf([cohort with status].[Intake Date] Between #27/04/2012# And #24/05/2012#,201202)...
  20. L

    simple SELECT CASE statement

    Hi there, I have a simple SELECT CASE query that I need help with. I'm not sure how the syntax goes and I want to learn about it. In the attached file, if you click on "cohort table", you will see the categorization for each unit under "field1". how will I be able to use a SELECT CASE...
Top Bottom