Search results

  1. P

    Problem with query accessing VBA function

    Try to set the datatype your funtion returns by: Public Function GetComboAttending() as String
  2. P

    Possible to copy/paste dirctory structure?

    Use the Xcopy command to copy your folder structure, like: Dim SourcePath as string Dim DestPath as string SourcePath = "\\Whatever Source\" DestPath = "\\Power & Industrial\Projects\" shell "xcopy " & chr(34) SourcePath & chr(34) & " " & chr(34) & DestPath & chr(34) & " /T/E" This sample...
  3. P

    7zip command line problem multiple file or folder contents

    By using using "For each" you are making a zip for each file :D What you want doesn't require a "for each" but can simply be done with wildcards. Use a variable or hardcode the required filename like: Shell Chr(34) & ZIPDIRPATH & Chr(34) & " a -tzip " & Chr(34) & FILEDEST & "\" &...
  4. P

    Error Handling

    I'm not sure what you're trying to do. If a bunch of query's need to run and if there's a error in one of them you would like to undo all. You need the BeginTrans, CommitTrans and Rollback methods. Look them up in the help. If all query's have to run and errors don't matter, put before the...
  5. P

    inserting unicode control characters in CSV file

    Use the VB constants "vbNewline" and "vbTab" on the appropriate place in the print string.
  6. P

    SQL Update and error capture?

    As I said, I didn't test it but you got the idea. You left out the Exit label bevor the ErrButtonUpRevision: label, this means that the last label will run always after the update. After CommitTrans Rollback will throw an error.
  7. P

    SQL Update and error capture?

    Did mis the multiple query's With the BeginTrans, CommitTrans and Rollback methods you should be able to achieve this. I did not test the following but it wil give you a direction. 'before your first query dbengine.BeginTrans 'after the last query dbengine.CommitTrans 'on error (in the error...
  8. P

    SQL Update and error capture?

    By replacing the DoCmd.RunSQL by CurrentDB.Execute the prompt for executing the query is gone. This can also be done by using docmd.SetWarnings false/true but you need to make sure that it's set back on if your code fails by using error trapping. To prevent the query from partly running use the...
  9. P

    Help needed for DoCmd.OpenForm!

    The place where you have acDialog (= 3) should either be acFormAdd (=0), acFormEdit (=1) or acFormReadOnly (=2). Why you end up in append mode :confused:, should be readonly & edit (= 2+1 = 3):D And mdlueck is right. Check the order of the openform arguments.
  10. P

    Help About Adding Up Sums Using A Checkbox

    As a checbox has a value of 0 or -1 the easiest way would be a calculated field with: abs(nz([Checkboxes],0))*nz([Quantity],0)*nz([Price Of Product],0) And sum the Calculated field in the footer of the form.
  11. P

    Check if any records exist in subform

    Your code fails because you are testing a subform, it's a control this means not null. You need to test if the recordsource of the form contains records like: If Me.Unissued_material_list_subform.recordsource.Form.Recordset.RecordCount <> 0 then
  12. P

    Printing linked files (word, pdf etc)

    The opening of the file is prepared in this line: r = ShellExecute(hwnd, "open", strFilePath, "", "", lngShowCmd) To print a file change it to: r = ShellExecute(hwnd, "print", strFilePath, "", "", lngShowCmd) To hide the program window change "vbNormalFocus" in the calling function to "vbHide"
  13. P

    Property not found - only getting error since upgrading to 2010

    I don't have Access 2010 here, "Property Not Found" message for a requery tells me that access does not know where to look. Try: Forms!frm_new_user.Form.Requery In Access 2003 the code runs with and without the .form.
  14. P

    Property not found - only getting error since upgrading to 2010

    The syntax is not the same as there's no reference to the menu, to save a record the syntax is: docmd.RunCommand acCmdSaveRecord
  15. P

    Property not found - only getting error since upgrading to 2010

    The DoCmd.DoMenuItem is replaced by Docmd.Runcommand for backwards compatibility most of te DoMenItem stil work, this one may not. For more information see this MSDN page
  16. P

    NotInList event not accessing current value

    AccountantCombo.text wil give you the value you're after.
  17. P

    Show All Columns on Subform on Open

    The code below in the open or load event of the subform should show all. Set ctl = me.Controls For Each F In ctl Me(F.Name).ColumnHidden = False End If Next
  18. P

    Re: Automate *.pdf (multiple reports) to send from Access thru MS Outlook

    Re: Automate *.pdf (multiple reports) to send from Access thru MS Outlook Again You can't filter a report in the Docmd.OutputTo function. To filter your report you need to open it first in preview mode then export it, like I did in my previous answer.
  19. P

    Re: Automate *.pdf (multiple reports) to send from Access thru MS Outlook

    Re: Automate *.pdf (multiple reports) to send from Access thru MS Outlook Place of original thread. Access doesn't like a Where parameter in the OutputTo command. To use it you have to open the report in front like: Dim strRapName as String Dim strWhere as String strRapName = "rptinvoice"...
  20. P

    OpenRecordSet problems

    In your code you set QryOrTblDef = "MyQuery", do you have a stored query called MyQuery? I'm not sure that a saved parameterquery works in VBA. Why not build a SQL string in your code based on the combobox like: QryOrTblDef = "Select * from YourTableNameHere where YourControlFieldNameHere = '"...
Back
Top Bottom