Search results

  1. Fornatian

    convert csv to xls

    Instead of With appExcel .Workbooks.Open FileName:=strCSVPath ActiveWorkbook.SaveAs FileName:=Left(strCSVPath, Len(strCSVPath) - 3) & "xls" _ , FileFormat:=xlNormal End With use With appExcel .Workbooks.Open FileName:=strCSVPath .Columns("A:A").NumberFormat =...
  2. Fornatian

    convert csv to xls

    Points taken.
  3. Fornatian

    Add A Field To A Table With SQL

    make reference to the backend database and execute the SQL statement 'there'. Public Sub AddFieldToAnotherDatabaseTable() Dim db As DAO.Database Dim dbPath As String Dim strSQL As String dbPath = "D:\My Documents\DesignNotes\Access\TestNames_be.mdb" strSQL = "ALTER TABLE tblNames ADD COLUMN...
  4. Fornatian

    enlarging an image

    Have these three controls on your form 1. A button called btnChangeSize 2. A small image control called imgSmall 3. A large image control called imgLarge Set the visibility of imgLarge to 'No'. Make the button's caption "Enlarge" (without quotes) Now add this code to the buttons click event...
  5. Fornatian

    convert csv to xls

    Actually I've been having a play and have worked out a straight conversion method. Include a reference to MS Excel in your VBA library (Tools-References in VBA Window) then add this public sub Public Sub ConvertCSVtoXL(strCSVPath As String) Dim appExcel As Excel.Application 'Switch to...
  6. Fornatian

    convert csv to xls

    No-one ever called me cute before :D Thanks Pat, I always like to hear your corrections of my attempts to help, I understand what you are saying re formats but CSV and XLS are very closely related, I would never attempt to open a word doc as an access db or vica-versa. I may be ill-informed...
  7. Fornatian

    convert csv to xls

    Seeing as the file info is excel interchangeable would create a duplicate file with an xls extension work? Dim csvPath as string csvPath = "C:\etc..." FileCopy csvPath, Left(csvPath,Len(csvPath)-3) & "xls"
  8. Fornatian

    enlarging an image

    There are a number of solutions to this, you could have a bigger image control present on the form and then toggle it's visbility when the 'enlarge' button is pressed. Alternatively you could alter the width/height of the original image control using something like Me.MyPicture.Height =...
  9. Fornatian

    Convert Seconds into HH:MM:SS

    I knew I was out somewhere, multiplying 3600 x 24hours is what I was actually getting at. Nice one PDX.
  10. Fornatian

    Placing a date on a report

    EXACTLY. You never have to type anything twice which is commonly used. They are not the panacea though, you have consider whether there is any real advantage in building a public sub or function. This is generally determined by the number of times it is called and how standard the actual...
  11. Fornatian

    Placing a date on a report

    Don't change the call in on the click event. When you create a public function, that function becomes available as if it were a 'normal' command, so you can call it from your form. The module itself is just a container (carrier bag) which stores all your common functions and sub procedures...
  12. Fornatian

    Convert Seconds into HH:MM:SS

    would: Format(([YourField]/3600),"hh:nn:ss") be as effective?
  13. Fornatian

    Placing a date on a report

    Change the name of the module (NOT the function) to something else. Because they are the same name it causes a conflict.
  14. Fornatian

    Placing a date on a report

    good to hear... BTW, here's a useful little function you can use to give your users the opportunity to print or preview a report from the same button click: ...add this function to a public module... Public Function PrintOrPreview(stDocName As String) On Error Resume Next 'resume next to...
  15. Fornatian

    Placing a date on a report

    DoCmd.OpenReport "Machine Select", acPreview If you haven't figured it out how to put the form's dates on a report yet you just add an unbound box and then set it's control source to something like: ="from "& [forms]![frmMachines]![StartDateField] & " to " & [forms]![frmMachines]![EndDateField]
  16. Fornatian

    Textbox SELECTS Listbox Entry

    cool code random, i understand why iRow should = 0 and not 1, rows in a listbox start at Row 0 not one, so if you search return and start typing the listbox searches from the 2nd row onwards. I think. :D
  17. Fornatian

    Placing a date on a report

    This would be so easy if you would move away from Input Boxes and use a criteria form instead. That way you can referebce the fields on the form from the query and on the resultant report and it looks really professional instead of input boxes which frankly are pretty ugly creatures IMHO.
  18. Fornatian

    Export Problem

    Use: If Dir("PathToFile")<>"" then 'file exists Kill "PathToFile" End if 'carry on...
  19. Fornatian

    Export Problem

    That's funny pat, I don't think I've put any kb patches on my db and it seems to work OK (pity about the rest of my PC though! :) ), Windows 98 SE & Access97. Just realised Access 97 is 'a few years ago' still going strong mind.
  20. Fornatian

    What am I missing

    stLinkCriteria = "[buildingno]=" & Me.BuildingNo
Back
Top Bottom