Search results

  1. R

    Loop macro using list of different parameters

    Thanks Colin. Here is the code for one of the macros that I want to loop: Function Standard_contract() On Error GoTo Standard_duplicate_contract_pre_price_freeze_Err KillMyFile DoCmd.OutputTo acOutputReport, "rpt_102 Page 1", "PDFFormat(*.pdf)", "h:\desktop\New contracts" &...
  2. R

    Loop macro using list of different parameters

    Hi All, I have a query which I want to run as many times as there are unique values in a field within a table in the same database. My query is set to look at a field on a form, but I would like to run this macro for all unique values in the table of which there are approximately 2,000! My...
  3. R

    Display all query fields even if criteria is not met

    Sorry to confuse you further CJ! Ok, for the above example, just replace location with new starter, and Birmingham with "New Starter". Shouldn't have added location into the mix, just tried to use it as an example! So if the answer is Peter Smith, "New Starter" would appear in the column. If...
  4. R

    Display all query fields even if criteria is not met

    Sorry, so my query is based on a table that has a column in it names "Sales Source". This is the staff member who has processed a sale. I want the query to display the Sales Source for each row, but based on the result of the sales source, display different results in another column. For...
  5. R

    Display all query fields even if criteria is not met

    Hi all, I have a query which has a field in it which returns a staff members name. I need a separate field which based on who it is that is named, will return either a specific text such as "New Sale" or a blank result if it is a different member of staff that is not listed in the criteria...
  6. R

    Adding query results to text in report

    Hi all, Is it possible, just like you would do on a mail merge in Word, to have a report that is predominantly text, but that has inserts which refers to the results of a query. For example, a query may return the result of a persons name and address, and I would need this to form part of...
  7. R

    Can you help me write a simple code?

    Colin...... I could kiss you right now!!! Thanks again :):):):)
  8. R

    Can you help me write a simple code?

    Nearly there!!! Ok, so the below code works perfectly other than I still get the error message appear, but at least it does open the test database and closes the one I started the code in. Is there a way of removing this error message? The error message only appears once and fills the screen...
  9. R

    Can you help me write a simple code?

    Ah I think I may have found the problem. I specified the exact path, but because the file is saved deep in many folders, some of which contain two words as the name of the folder, it is the space in these e.g. G:\2018\Data\Client Data\.... that is causing the problem. It looks like up to...
  10. R

    Can you help me write a simple code?

    Thank you jdraw. I have copied and pasted your edited code over mine, but still get the same error message: The command line you used to start Microsoft Access contains an operation that Microsoft Access doesn't recognise. Exit and restart Microsoft Access using valid command-line options.
  11. R

    Can you help me write a simple code?

    I have no idea how the back slash appeared to be missing when I copied and pasted the above...it was definitely there in the code (which is as below), but I am still getting the error message Public Function OpenDatabase() On Error GoTo ErrHandler Dim strPath As String, strName As String...
  12. R

    Can you help me write a simple code?

    Sorry Colin, I didn't think it would work as I read it that the first DB would still be open. I have tried it now, (every file is saved in the same folder so I assume the only thing I need to replace in the code you kindly provided is the file name - Test.accdb). So I put the below in a...
  13. R

    Can you help me write a simple code?

    Yes, and that's great I really do appreciate this - but as far as I understand it, this wont work as the 1st database will already be open and this stops the code working as planned which is why I was trying to work out a way of closing one database and opening another in that order
  14. R

    Can you help me write a simple code?

    Ok so my problem is. I have a linked table in an Access database to an excel file. The Excel file gets data from an external source and I need to refresh the connections to allow me to use the new data which can change multiple times throughout the day. So I have the code that does this...
  15. R

    Can you help me write a simple code?

    Would putting some sort of timer on the open code allow the process to start, but with enough of a delay to allow the other database to be closed before the 2nd database actually opened?
  16. R

    Can you help me write a simple code?

    The table holds data that can change at any time, multiple times, throughout the day. It is normally when a user knows that something in the data has changed that they will then need to refer to this to complete a task. The users could just go in an refresh the table but not all users have...
  17. R

    Can you help me write a simple code?

    I need to have DB1 so to speak, the active database, close before DB2 opens. Is there a way of doing this? All the codes I have mean that as soon as DB1 closes it stops the process of being able to open a second database. When DB2 opens, I have set a module to run on a form opening which does...
  18. R

    Can you help me write a simple code?

    Sadly its really not! I am trying to use this solution to get around a problem I have with a linked table which I cant refresh the connections in because the file is always "open" due to it being linked. This way, I would close the database with the linked table, open the new database with the...
  19. R

    Can you help me write a simple code?

    Hi all, Here is what I want to do, I just need a code to help me do it! Close an open and active access database (DB1) Open another database (DB2) Close DB2 Open DB1 It sounds simple enough but I just cant work out how to do it! Many thanks in advance
  20. R

    I must be missing soemthing obvious!

    I am still having problems with the excel file opening in read only. Is this because the table I am opening is a linked table in the access program and therefore already active or open. Is there a way I could break the link, or perhaps change the module to close the access project to make the...
Back
Top Bottom