Posts by Mavyak

    Re: Code To Generate Data Table


    I think that "Selection" is activesheet dependent. So essentially, you are specifying a cell on a different sheet for your columninput argument. Perhaps you should define a variable of type range named TableRange and set it equal to the selection on sheet Calculator. Then you should be able to use TableRange.Table ColumnInput = RefCell. I've never dealt with a Range.Table object via VBA before so this is all a best guess on my part.


    hth,


    Mavyak

    Re: Remove Or Delete Duplicate Rows


    I'm interested in seeing how that will work. I understand that you will have the sum of all the records after the duplicates are removed but I believe Rajala needs the values summed at the duplicate level (essentially a group by for the first five columns and a sum on the sixth). The first thing that comes to my mind is SQL via ADO:



    That code puts the result set in a new worksheet leaving the original values intact. It could be quickly edited to replace the original values with the result set, though.

    Re: Outlook, Recognise Email, Save Attachment, Move Email To A Subfolder


    Re: Outlook, Recognise Email, Save Attachment, Move Email To A Subfolder



    I think that will work. Not positive, though. It's untested.

    Re: Uploading Multiple Records From .xls To Sql Server As Single Batch (ado/jet/odbc)


    Can you create the staging table and a stored procedure to move the data from the staging table to the live table? That way, Excel would run the data to the staging table and upon completion of the upload the same ADO connection could be used to call the stored procedure to move the data from the staging table to the live table. That way, your trigger would remain intact and would only fire once for the stored procedure.

    Re: Running Sum Until


    I'm pretty sure this can be done in Oracle and possibly SQL Server too. I don't believe Access has the ability. If the tables in Access are actually linked tables to an Oracle or SQL Server back-end then we could use native SQL via a pass-through query to return the results you're looking for. In Oracle, the following would produce a running total of a field named TRADE_AMOUNT (titled RUNNING_TOTAL) in the reverse order of the time the trades occurred:


    SELECT
    [indent]TRADE_ID,
    TRADE_DATE,
    SECURITY_ID,
    TRADE_AMOUNT,
    TRADE_AMOUNT + LAG(TRADE_AMOUNT, 1, 0) OVER (ORDER BY TRADE_DATE DESC) AS RUNNING_TOTAL[/indent]
    FROM
    [indent]TRADES[/indent]

    Re: E.spreadsheet Designer Sql Reports



    No charge...

    Re: Calculation On Table


    SELECT
    [INDENT]T1.Product_Code, (T1.value/T2.Value) As Product_Value[/INDENT]
    INTO
    [INDENT]NEWTABLE1[/INDENT]
    FROM
    [INDENT]TABLE1 T1[/INDENT]
    [INDENT]INNER JOIN TABLE2 T2 ON T1.Product_Code = T2.Product_Code[/INDENT]

    Re: Concurrent 80004005 And 80040e14 With Ado Jet


    You can also add:


    Code
    1. On Error Goto errHandler


    as well as:



    to the end. The Connection object might have a better description of the error in question.

    Re: Add Attachment To Email


    I'm kind of out of my element with the Outlook object model but I do have two possibilities:


    1. An alternate spelling for Cancellation is to use one "l" (e.g. Cancelation). Is the file spelled the same way in your code as it is on your harddrive?
    2. I don't believe you need to enclose the file name in parentheses, only quotation marks. Parentheses usually indicate that the associated function is returning a value to a variable. In this case it is not.


    hth,


    Mav

    Re: Combining Iif Statements


    Nest the if statement into the False result of the first if statement like this:

    Code
    1. IIf([Recipient City]=[Recipient Original City]," ",IIf([Recipient Original City]="New York City", " ", "Bad City"))