User Profile

Collapse

Profile Sidebar

Collapse
izharmel
izharmel
Last Activity: Mar 20 '11, 02:38 PM
Joined: May 23 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • izharmel
    started a topic importing a csv to access 2007 using vba

    importing a csv to access 2007 using vba

    Hi,
    I import a csv file to an access table using the following code as a part of a larger code:
    Code:
    DoCmd.TransferText acImportDelim, , strTableName, strPath & objFile.Name, True
    Prior to the import, I imported the table manually, so that I have a base table to import to.
    Every time I import, I delete the data from the access table and import the new one onto it.
    It works fine except for the fact...
    See more | Go to post

  • izharmel
    replied to Closing an Excel instance
    What I did was open the task manager while working "step by step" through my code.
    The excel instance only appears when it is opened in this function.
    The code reaches the end without any breaks, so i assume all the rest is OK...
    See more | Go to post

    Leave a comment:


  • izharmel
    replied to Closing an Excel instance
    Doesn't work...

    Hi everyone,
    Thank you very much for the help,
    I tried everything that you told me.
    While debugging I saw that xlWb.Close closes the excel rectangle from the task bar but leaves the instance in the task manager.
    xlApp.quit doesn't seem to do anything... (that's why I left it out in the first place).
    Any thoughts?
    Code:
    Sub PrepareExcel(FileNme As String)
    ...
    See more | Go to post

    Leave a comment:


  • izharmel
    replied to Closing an Excel instance
    after reading many pages of people with the same problem I realized that the code is relevant to the closing proccess so here's the whole thing
    Code:
    Sub PrepareExcel(FileNme As String)
    
    Dim xlWb As Excel.Workbook
    Dim xlSh As Excel.Worksheet
    Dim Rng As Range
    Dim LastRow As Long
    Dim LastCol As String
    Dim LastCell As String
    
        Set xlWb = Workbooks.Open(CurrentProject.Path &
    ...
    See more | Go to post

    Leave a comment:


  • izharmel
    started a topic Closing an Excel instance

    Closing an Excel instance

    I wrote a code which exports an access table to excel and then manipulates it.

    it works OK, but leaves an EXCEL.EXE line in the task bar...
    what am I doing wrong?
    Code:
    Sub PrepareExcel(FileNme As String)
    
    Dim xlWb As Excel.Workbook
    Dim xlSh As Excel.Worksheet
    Dim Rng As Range
    Dim LastRow As Long
    Dim LastCol As String
    Dim LastCell As String
    
        Set xlWb
    ...
    See more | Go to post

  • izharmel
    replied to How do I create an Average table
    hi,
    I just fixed the problem (after days of work)

    here's the code:
    Code:
    Function Av_Calc(AvNum As Integer, TableNme As String)
        Dim db As DAO.Database
        Dim rs As DAO.Recordset
        Dim SQLrs As String
        Dim ShowField As String
        Dim Diff As Long
        
        Set db = CurrentDb
        DoCmd.SetWarnings False
        DoCmd.RunSQL "DROP TABLE T_Average"
    ...
    See more | Go to post

    Leave a comment:


  • izharmel
    replied to Average time
    Averaging function

    fixed the problem!

    here's the code:
    Code:
    Function Av_Calc(AvNum As Integer, TableNme As String)
        Dim db As DAO.Database
        Dim rs As DAO.Recordset
        Dim SQLrs As String
        Dim ShowField As String
        Dim Diff As Long
        
        Set db = CurrentDb
        DoCmd.SetWarnings False
        DoCmd.RunSQL "DROP TABLE T_Average"
    ...
    See more | Go to post

    Leave a comment:


  • izharmel
    replied to How do I create an Average table
    Thank you for the huge help.
    I'll also try to change my approach and tell you how it goes.
    See more | Go to post

    Leave a comment:


  • izharmel
    replied to Average time
    The actual function is a bit more complicated:
    Code:
    Function Av_Calc(AvNum As Integer, TableNme As String)
        Dim db As DAO.Database
        Dim rs As DAO.Recordset
        Dim SQLrs As String
        Dim ShowField As String
        Dim Diff As Long
        
        Set db = CurrentDb
        DoCmd.SetWarnings False
        DoCmd.RunSQL "DROP TABLE T_Average" 'delete existing T_Average Table
    ...
    See more | Go to post

    Leave a comment:


  • izharmel
    replied to How do I create an Average table
    This is what I have so far

    I'm kinda stuck...
    Code:
    Function Av_Calc(AvNum As Integer, TableNme As String)
        Dim db As DAO.Database
        Dim rs As DAO.Recordset
        Dim SQLrs As String
        Dim ShowField As String
        Dim Diff As Long
        
        Set db = CurrentDb
        DoCmd.SetWarnings False
        DoCmd.RunSQL "DROP TABLE T_Average" 'delete existing T_Average
    ...
    See more | Go to post

    Leave a comment:


  • izharmel
    started a topic Average time

    Average time

    Hi,
    I have a function in Access VBA which uses an SQL code to create an average table from an existing table.
    The original table may look something like this:

    Time Data_1
    03/08/2010 12:41:20 10
    03/08/2010 12:41:30 13
    03/08/2010 12:41:40 15
    03/08/2010 12:41:50 23
    .
    .
    .

    with many thousands of rows.
    I'm trying...
    See more | Go to post

  • izharmel
    replied to How do I create an Average table
    I wish it were.
    Since even when the function works, it's very slow (approx 10 minutes) I decided to try an approach it from an SQL point of view.
    so far I have :
    "SELECT [Time], AVG(other fields), INTO 'new Table' FROM 'old table' GROUP BY (time/60/AvNum)"
    I think the average part is correct but displaying the time doesn't work well...
    See more | Go to post

    Leave a comment:


  • izharmel
    replied to How do I create an Average table
    Debugging

    Hi,
    I thought I had the function working...
    It actually works fine for some months but when I tried averaging July it doesn't take any data from rs to rsTemp.
    It's as if the [Time] column doesn't fulfill the terms for the SELECT Query.

    Code:
    Function Av_Calc(AvNum As Integer, TableNme As String)
        Dim db As DAO.Database
        Dim rs As DAO.Recordset
        Dim rsTemp
    ...
    See more | Go to post

    Leave a comment:


  • izharmel
    replied to How do I create an Average table
    Thank you
    it works great
    See more | Go to post

    Leave a comment:


  • izharmel
    replied to How do I create an Average table
    creating a sub-record set from an existing one

    Hi,
    I'm trying to combine your function into what I already have.
    So far I have a record set with all the information I want.
    I run a do while loop on it, to to take a 10 minute segment each time (for example) and pass it on to your function.

    Code:
    Do While Not rs.EOF
            rs.MoveNext
            'add num of minutes requested to the
    ...
    See more | Go to post

    Leave a comment:


  • izharmel
    replied to How do I create an Average table
    Thank you very much,
    I'll integrate it into what I already have and I'll let you know how it goes.
    See more | Go to post

    Leave a comment:


  • izharmel
    replied to How do I create an Average table
    OK, the original table would look like:

    15/06/2010 12:31:00 1970 151.7 2360 116.8
    15/06/2010 12:31:10 2000 163.4 2370 127.5
    15/06/2010 12:31:20 1990 142.8 2360 112.7
    15/06/2010 12:31:30 1990 142.8 2360 109.4
    15/06/2010 12:31:40 1960 144.3 2360 110.7
    15/06/2010 12:31:50 1950 157.2 2360 121.5
    15/06/2010 12:32:00 1940 155.8 2360 122
    .
    .
    .

    and the the result table...
    See more | Go to post

    Leave a comment:


  • izharmel
    started a topic How do I create an Average table

    How do I create an Average table

    Hi,
    I am trying to create a function to receive a table with a changing number of columns (for each time the function is called).
    The first column is always time, in the format "dd/mm/yyyy hh:nn:ss". Every ten seconds there is a new row with many columns of numerical data.
    The user writes a number of minutes in a text box, for instance 10,
    and the function returns a table containing all the original columns but...
    See more | Go to post

  • izharmel
    started a topic creating a universal averaging function

    creating a universal averaging function

    Hi,
    I wrote (with some help) a function which receives a table of numerical data, and outputs another table which contains the average value from each user picked number of lines and the maximum from that range.

    Code:
    Function Average_Max(cntr As Integer)
        Dim db As DAO.Database
        Dim rs As DAO.Recordset
        Dim time1 As String
        Dim av As Long
        Dim mx As Long
        Set db
    ...
    See more | Go to post

  • izharmel
    replied to How to declare a global integer in VBA?
    Thank you,
    You helped me a lot
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...