Search results

  1. B

    Access LDAP through Access 2010 & VBA

    It could be that the ADsPath in your GetObject statement is not properly formed. You might try getting the ADsPath via an LDAP query. Also, your code assumes that your Active Directory is maintained on the Domain Controller. You might check with your IT Administrator that they do not have a...
  2. B

    Temporarily Save File in Attachment Field to Email

    To determine this, you might try stepping through the code in Debug mode, then right after executing the line rsA("FileData").SaveToFile strFullPath, try to open the file and see if it has been written correctly to the drive.
  3. B

    Temporarily Save File in Attachment Field to Email

    You might try changing: cdomsg.AddAttachment strFullPath ...to: With cdomsg .AddAttachment strFullPath .Attachments(1).Fields.Item("urn:schemas:mailheader:content-disposition") = _ "attachment; filename=" & Dir(strFullPath) .Attachments(1).Fields.Update End With
  4. B

    open form in datasheet view

    Change: DoCmd.OpenForm "What if" ...to: DoCmd.OpenForm "What if", acFormDS
  5. B

    Error in the access vba code

    By any chance, is this code inside a module in File1.xlsm itself?
  6. B

    Error in the access vba code

    Three other corrections to be made that I just spotted: Change 1: With ActiveSheet to... With objBook1.ActiveSheet Change 2: objBook1.SaveAs "C\Desktop\" & Format(Now(), "mm-dd-yyyy") _ & " File2.xlsm ", FileFormat:=xlOpenXMLWorkbookMacroEnabled ...to: objBook1.SaveAs "C:\Desktop\"...
  7. B

    Error in the access vba code

    Actually, the FileFormat is correct. However, the following modifications need to be made: objBook1.SaveAs "C\Desktop\" & Format(Now(), "mm-dd-yyyy") _ & " File2.xlsm ", FileFormat:=xlOpenXMLWorkbookMacroEnabled objBook1.Saved = True objBook1.Close False
  8. B

    param query in VBA against MySQL

    Try setting the parameter argument as ? in your SQL statement, but leaving the parameter name as @kc in your CreateParameter statement, like the following: Dim pkc As String Sql = "SELECT * FROM Accions WHERE keyclient = ?" cmd.ActiveConnection = cn cmd.CommandText = Sql pkc = "AMC" Set param...
  9. B

    Automate FTP Download (copy) Via VBA

    The ftpGet function shown below should do what you require. Example usage: ftpGet "ftp://ftp.myftphost.com/MyFolder/MyFile.docx", _ "C:\MyFolder\MyFile.docx", _ "MyUserName", "MyPassword" Public Sub ftpGet( _ ByVal strURL As String, _ ByVal strFileName As String, _...
  10. B

    How to create .HTMLBody tables for Outlook Email

    Try changing your code to: .HTMLBody = "<HTML><BODY STYLE=font-size: 16pt; font-family: Calibri>" _ & "<table><tr><th>Fields Changed:</th><td>" & strControlName & "</td></tr>" _ & "<tr><th>Project Address:</th><td>" & strProjectAddress & " " _...
  11. B

    Can't send email through SSL server using CDO

    You say it does not work. Could you be more specific? For example, is there an error message that you can share with us so that we can help you diagnose the problem?
  12. B

    Left Join error, look field has 1 extra character

    You might try this for your FROM/JOIN clause: ... FROM ( SELECT *, Left([Contract #], 9) AS SiteID FROM [Total Billables Table]) AS [Total Billables Table] LEFT JOIN [10 Account Mappings] ON [Total Billables Table].SiteID = [10 Account Mappings].SiteID;
  13. B

    Counting Consecutive Months in Access

    Hello, CoolDude2000, For a SQL Server database, there needs to be a change to the SQL: SELECT T1.fName, COUNT(T1.fDate) AS CountOfDate FROM (SELECT DISTINCT T.fName, DATEADD(m, DATEDIFF(m, 0, T.fDate), 0) AS fDate FROM MyTable T) T1 WHERE T1.fDate >= (SELECT MAX(T2.fDate) FROM...
  14. B

    Saving Excel files through Access

    How about: If strFullPath <> "" Then objWorkBook.SaveAs FileName:= _ strFullPath, FileFormat:=xlOpenXMLWorkbookMacroEnabled, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False End If
  15. B

    Saving Excel files through Access

    You might try the following revision: If strFullPath <> "" Then objWorkBook.SaveAs FileName:= _ strFullPath, FileFormat:=xlOpenXMLTemplateMacroEnabled, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False End If
  16. B

    Saving Excel files through Access

    Could you show us the line(s) of code you are using to save the file?
  17. B

    VBA - Save Word Do as HTML

    You can try: .ActiveDocument.SaveAs fileName1, wdFormatHTML
  18. B

    http/https request

    Hello, Forro, It is still not clear how you attempted to implement these solutions. You have told us what you attempted to do, but could you perhaps post some code that you have tried, or even attach a copy of the database for us to look at? From there we might be able to help.
  19. B

    Refresh subform from a different form

    Try changing the highlighted code: Private Sub lblClose_Click() If CurrentProject.AllForms("frmOperations").IsLoaded Then Forms!frmOperations!subfrmPlants.Form.Requery End If DoCmd.Close acForm, "frmPlants", acSavePrompt End Sub
  20. B

    For control variable error

    You forgot to close the previous For...Next clause: 'Coverage code i = Range("J" & Rows.Count).End(xlUp).Row For Each rngCell In Range("J2:E" & i) Select Case rngCell.Value Case Is <= 120 rngCell.Interior.Color = RGB(255, 255, 0) 'Yellow Next...
Back
Top Bottom