Recent content by steve-oc

  1. S

    How to tell if a Query Exists

    This should work dim qdf as DAO.querydef ' loop thru all querydefs in db for each qdf in currentdb.querydefs debug.print qdf.name if qdf.name = "your-query-name" then ' you've found it! end if loop HTH
  2. S

    OLE Insert Object - Word Doc

    Ok, there's a DB of scheduled events - date/time, venue, etc. Each event has a bit of, say 100 word, descriptive text associated with it (what the event is about - programme copy). This needs to be formatted as per MS Word - bold italic, etc. Then I need to output the event date/time, venue data...
  3. S

    OLE Insert Object - Word Doc

    I know about the bloat issues and usually link to external docs via Word automation but this is a bit of a one off. So, no I don't need to link to an existing external doc. Alternatively - I can set a form OLE control to dynamically display an external doc Const stRoot As String =...
  4. S

    OLE Insert Object - Word Doc

    Hi I have a table with a column defined as OLE - called EventCopy. When in table view or on a form with the control bound to this field I can choose Insert from the menu (or right click option) and choose Object and then MS Word Document. How can do this 'behind the scenes'? - ideally when...
  5. S

    build list of dates as string

    Yep, I get that - it's just the comparison isn't just last record, next record. It has to include the next again to see if it's a sequence greater than two (if so start a <first date> hyphen <find last date in sequence>) otherwise separate them by comma, move next... Is making my head hurt -...
  6. S

    build list of dates as string

    Hi I have a table of dates, say: 2009-01-15 2009-01-16 2009-01-17 2009-01-18 2009-01-21 2009-01-22 2009-01-25 2009-01-26 2009-01-27 2009-01-30 I'm trying to write a function that will pull these dates into a rst and then output as: 15-18, 21, 22, 25-27 & 30 January 2009 ie identifying where...
  7. S

    loop through recordset

    if rst.eof then ' EOF = end of file - there are no records msgbox "No records" exit sub rst.movelast ' without .movelast your record count will be one ' once you've moved to the end you'll ' know how many records there are msgbox rst.recordcount
  8. S

    'Mail to all' button

    Agreed - that is the neatest solution (provided you can manage your Outlook lists) but was just trying to illustrate the principle of solving the original question ie get a list of email addresses in the To: field. Should also point out my code will loop forever with out a .MoveNext here: With...
  9. S

    'Mail to all' button

    Concatenate Emails to Single Field Public Function ConcatenateEmails() As String Dim dbs As DAO.Database Dim rst As DAO.Recordset Dim stTo As String Dim stSQL As String stSQL = "SELECT email FROM employeedata;" Set dbs = CurrentDb() Set rst = dbs.OpenRecordset(stSQL) With rst Do While...
  10. S

    convert access report to pdf file?

    Hi This is what I do... If you set the default printer to in the report properties: File/ Page Set Up/ Page tab - 'Use Specific Printer' = Acrobat Distiller then choose properties for the printer and then the Adobe PDF Properties tab then untick 'Prompt for file name' and also 'View in...
  11. S

    avoiding duplicates in string problem

    Hi not sure where strDuplicate is getting it's value from... can you not use the logic: if Instr(strEmailAddresses, rst![EmailAddress]) >0 then ' email address already in list so move to next record look up the Instr function if you're not familar with it - it checks to see if a string...
  12. S

    Please help me with this problem.

    only know vague DAO stuff but... do you not need .edit and .update cmd steve
  13. S

    Manipulating data via VBA - confused...

    Hi - I have an inherited dataset that needs normalising. Current Structure: tblAccommodation PersonID (integer & PK) 13th (boolean) 14th (boolean) 15th (boolean) and so on until 29th Sample: PersonID, 13th, 14th, 15th, 16th, 17th, 18th, etc 1, yes, no, yes, yes, yes, no, yes 2, yes, yes, yes...
  14. S

    form takes an age to close after new data

    hi - thanks for that. my forms are based on queries and have run compact & repair. as a test i have merged the front end & back end back together and everything works much quicker and runs smoothly. so am positive that the perfomance issues are wth the splitting and runnng acroos the network. do...
  15. S

    form takes an age to close after new data

    I have a form frmPerson and a sub on that form subLinkedPerson. The records on the sub are filtered via the Person_ID. There is a button on the main form to bring up a list of contacts, upon which you can choose one and run a line of SQL to link the new conatct to the main person_id, the subform...
Back
Top Bottom