Recent content by Broker666

  1. B

    Import from spreadsheet and overwrite existing

    Any help would be much appreciated. What I basically want to do is import data from a spreadsheet and if it already exists (based on the primary key value) overwrite it. If data in the table does not exist in the spreadsheet I want it to remain there. Most of the solutions I have come across...
  2. B

    Import from spreadsheet and overwrite existing

    Hi, Basically I have a macro that runs the TransferSpreadsheet action to import data from an Excel file. As it stands if the field containing the primary key already exists it will flag an error message and not import that record. What I want to do is overwrite the current record with the new...
  3. B

    Suggestions for solution to run access macro in receipt of email

    Hi Spike, That works perfectly, thankyou. I do however now have another problem. When I substitute my 'test' macro (which just contained a msgbox as a proof of concept) with the intended macro it says that I am making an illegal function call. The macro is linked to a button (Command60)...
  4. B

    Suggestions for solution to run access macro in receipt of email

    Ok, I have it running now using the below code but still can't work out how to test for an open session of Access and only create one if it is not already open, otherwise sub routine in the current session? Sub RunAccessMacro(MyMail As MailItem) Dim LPath As String Dim LCategoryID As Long...
  5. B

    Suggestions for solution to run access macro in receipt of email

    Hi, Currently I have a rule within Outlook to move mails meeting certain criteria to a specific folder and display a msgbox confirming that a new mail (which contains a report in text file format) has been received. I then run some code within Access which downloads the text file attachment...
  6. B

    Help needed opening instance of Outlook from Access and running code

    Now runs perfectly, thanks for your help.
  7. B

    Help needed opening instance of Outlook from Access and running code

    Hi, I have the following code which downloads any email in a specific inbox sub-folder to a specified location and then deletes it. It works fine when I call the sub routine directly from Outlook, but when put the code into a module in Access it says there is a compile error and that the...
  8. B

    How to divide result of one select query by another?

    Do you see anything wrong with the syntax here? Select Count(iif(Status = 'Sed - T+ 0',1) as expr1, Count(iif(status Is Not Null AND status <> 'Cancelled',1) as expr2, expr1/expr2 as expr3 From P_T WHERE Bwer = Bwer = Forms!Stats!Combo2;
  9. B

    How to divide result of one select query by another?

    Excellent, thanks Brian.
  10. B

    How to divide result of one select query by another?

    Hi, I'm struggling with the correct syntax for this, but ideally what I want to achieve is: SELECT (SELECT Count(Status) FROM P_T WHERE 'criteria are met') / (SELECT Count(Status) FROM P_T WHERE 'different criteria are met') They are both fairly simplistic select statements, so I imagine...
  11. B

    Combobox as variable in where clause

    Here's where I'm at with it now. I have a form that contains nothing but a combobox, which contains all possible values for the borrower field in the table Pnd_Trades. What I want to do is select a borrower from the combobox and then get it to launch a report based on the below query: SELECT *...
  12. B

    Code question - problems including windows login as variable in file name

    Works like a dream, thanks Bob. Hopefully one day I will be able to offer to same sort of good advice I always receive on this forum. Regards, B.
  13. B

    Code question - problems including windows login as variable in file name

    Hi Bob, Thanks for getting back to me, it seems to like to code but cannot find the file? I have returned the User_FX variable to a msgbox and it is 'Administrator' and the file is saved as C:\Options\G_Reports\G_Reports_Administrator.xlsx so i'm not sure what the issue is, any ideas?
  14. B

    Code question - problems including windows login as variable in file name

    Hi, I'm trying to delete a file that uses the user's windows login id as a variable in the file name but am having a little trouble. I think I'm nearly there... I've assigned the windows login ID to the string User_FX with a function and have written the following code, but it returns an error...
  15. B

    Combobox as variable in where clause

    Would really appreciate some advice on this.:confused:
Back
Top Bottom