Search results

  1. A

    Solved Run time error 31519 when trying to import CSV file

    Hi All, I am trying to add the facility for my users to import a CSV file via a button on a form. The code in the on click event of the button is: DoCmd.TransferText acImportDelim, "ImportTempT", _ "S:\IT\1 - Testing\CSVTestTwo.csv", True But I keep getting the run time error saying...
  2. A

    Query with multiple inner joins

    Thanks for your help. I did get it to save making the changes but then I had other criteria to add in and I couldn't get it to work. However, I've managed to figure out how to get the results I need using design view in Access. :)
  3. A

    Query with multiple inner joins

    Hi All, I have a mailing list form in my database were I need to filter organisations by 4 geographical areas. i.e. UK region, local authority, constituency and combined authority. Sometimes I will need to search for and send emails to all organisations for a certain region or local authority...
  4. A

    Solved Problems with code execution following email

    Thanks @Gasman and @adhoustonj that's much clearer and will help loads whilst I'm still testing after my code review. :)
  5. A

    Solved Problems with code execution following email

    It works!!!! Thanks so much! :D
  6. A

    Solved Problems with code execution following email

    I can see why it needs an exit sub as it still sends the authorisation email if the date is left blank. However, when I leave in the exit sub in both sections of code, it stops the rest of the code running even if the date is completed. Everything works perfectly without the Exit Sub except...
  7. A

    Solved Problems with code execution following email

    Thanks for the suggestion, I have managed to get it working after adding the variable. There was an error in there too so updating it has helped. I just wanted to ask about debugging too as I've never managed to get it to work. Does this only work with modules or should it work with the code...
  8. A

    Solved Problems with code execution following email

    Thanks all for your help and suggestions. So I have the SaveFirstAuth_Click() sub working now. It turns out that I used 'msg' twice for different variables. This was included in the error handling which is maybe why I think the error handling didn't trigger. I also updated this: If...
  9. A

    Solved Problems with code execution following email

    I have removed the .send from this code but it still doesn't work and still no error message :confused:
  10. A

    Solved Problems with code execution following email

    Yep, there's no error message at all with the error handling. I have been trying to make an error message pop up so it would help me debug but there's nothing! Thanks for the feedback too, that's so much cleaner. Interestingly, I have some similar code for the next part of the process which...
  11. A

    Solved Problems with code execution following email

    Hi I'm having problems with a section of code which previously worked but I can't see why it isn't fully executing now. Here's the code: Private Sub SaveFirstAuth_Click() Dim OrgURN As String Dim GrantURN As String On Error GoTo ErrorHandler OrgURN = "Org URN " & Me.OrganisationURN GrantURN...
  12. A

    Solved How to use ME in a public function

    Thanks for this. I can see the point about adding a With block to the code to close forms and that it doesn't really make sense to do that. @MajP thanks for the example of the good With block, there are loads of examples such as this that I can update and make it much more readable. :)...
  13. A

    Solved How to use ME in a public function

    Hi David Thanks for this, it works great! I note the comments about using a With block. How would I do this in this instance? There's definitely other areas in the code that I could use a With block rather than repeating lines of code. :)
  14. A

    Solved How to use ME in a public function

    Hi I have the following code in most of my forms when exiting. Private Sub ExitComms_Click() On Error GoTo ErrorHandler Dim ctl As Control 'If record is changed do you want to save changes If Me.Dirty Then If MsgBox("Do you want to save changes?", vbYesNo + vbQuestion, _...
  15. A

    Solved Auto email error needed if attachment file doesn't exist or is named incorrectly

    Hi, Hoping someone can help. I have the following code in my database which, when a payment is authorised, will send an automatic email to our finance team to say the payment needs to be made and will also attach the bank statement from a file directory. However, if the file doesn't exist/is...
  16. A

    Solved How to define a conditional string in VBA

    Hi David, That's great! I changed Left to Right as the 'Sub' was at the end and it worked a treat! Many thanks :) Allison
  17. A

    Solved How to define a conditional string in VBA

    Hi, I have the following code in the form load event of my reporting form: Dim NewValList As String NewValList = "" Dim obj As AccessObject For Each obj In CurrentProject.AllReports NewValList = NewValList + Chr(34) + obj.Name + Chr(34) + ";" Next obj Me!ReportCombo.RowSourceType = "Value...
  18. A

    Super Easy Word Merge and restricting editing

    Hi Colin, I wouldn't really know where to start with updating the code. Although I've learnt loads in terms of VBA programming over the last few months, I'm nowhere near experienced enough to know what to update. I have had a look through the module and wondered whether I need to amend this...
  19. A

    Super Easy Word Merge and restricting editing

    Hi, I am using Albert Kallal's super easy word merge in my database. When I add templates I need to be able to restrict editing of the word document for document control purposes. However, this option isn't available when I add the template. Is this intended or should I be able to restrict...
Back
Top Bottom