Search results

  1. P

    Waiting for OLE Action to complete

    Try one of the solutions given in the MS knowledgebase.
  2. P

    Automated Printer Selection & Page Setup

    After setting the printer use set application.Printer.PaperSize = 3 'constant is acPRPSTabloid
  3. P

    Automated Printer Selection & Page Setup

    It is possible to do this in the OnOpen event, checkout "application.Printer.DeviceName" and the other members of Printer. I think it would be easier to select a custom printer for your report, the drawback is that if the printer is not available you get a warning.
  4. P

    Syntax error - variable not found

    You don't have a reference to the "Microsoft Office 14 object library" (14 for office 2010).
  5. P

    multiple check for value-URGENT need

    Your check on nz(ctl.Column(15) , 0) wont work, ctl.Column(15) is a zero length string. A ZLS is not null but "". You can rewrite your code like: if "" & ctl.Column(15) = "" then ... Check your table structure for ZLS. Or fix the ZLS with following code Function RemoveZLSfromDB() 'Function to...
  6. P

    Which loop to use?

    You can do it without an array, simply test the value before setting the variable after the first Select case like: Select Case Me.num500Hz Case 0.92 To 1 if strClass < "A" then strClass = "A" Case 0.84 To 0.92 if strClass < "B" then strClass = "B"...
  7. P

    Appointment in non default Outlook Calendar

    In my case it is for exchange, check the properties of the folder where you want to save and use that (including the sub folder).
  8. P

    Appointment in non default Outlook Calendar

    I move the appointment after creation like: Dim moveCal As AppointmentItem Dim Calfolder As Outlook.Folder With objAppt .Start = Me!ApptDate & " " & Me!ApptTime .Duration = Me!ApptLength .Subject = Me!Appt End With Set Calfolder = GetFolderPath("\\User@domain.com\Calendar") '...
  9. P

    Object Variable Not Set

    I think the error is because Selection is part of Word and then it should be: wdDoc.Selection.TypeText ObjHead
  10. P

    find all table names from external file

    Try opening a workspace to hold the database like: Dim WS as workspace Dim db As Database Dim td As TableDef Set WS = CreateWorkspace("DBtoReadTables", "admin", "", dbUseJet) Set db = WS.OpenDatabase(path, True) For Each td In db.TableDefs Debug.Print...
  11. P

    find and replace

    For default values the code below should get you started. Function ChangeDefaultValueInTables() Dim tblDefs As TableDefs Dim tbl As TableDef Dim fld As Field Dim ChangeCounter As Integer Dim OldValue Dim NewValue OldValue = "2300" 'if its a nummeric field remove the quotes NewValue = "2400"...
  12. P

    FileDialog 429 Error

    The error is because Documents works only on a container and there is none set in your code. What are you trying to do? Opening the file, try: Application.FollowHyperling(Filename)
  13. P

    Count the total number of integer in a list

    I agree, when I hit submit I tought the same :D But with a range the first item is also an entry so your code would be one short. count = count + vRange(0) - vRange(1) + 1
  14. P

    Count the total number of integer in a list

    With the split function you can do a custum function like: Function CountItemSequence(ItemSequence As String) As Integer Dim varSplitItemSequence Dim varSplit varSplitItemSequence = Split(ItemSequence, ",") For Each varsplit In varSplitItemSequence If varsplit Like...
  15. P

    Warn But Not Prevent Duplicate Data

    Your msgbox code doesn't check what to do, you can give a OK only and it will be canceled by the next line. Try: Private Sub NI_number_BeforeUpdate(Cancel As Integer) if Dcount ("[NI_number]", "LearnerDetails", "[NI_number] = '" & Me.NI_Number & "' AND [PrimaryKeyField] <>" & Nz(Me!PKField,0))...
  16. P

    Help with Looping thru RS to Output PDF

    You need to filter your report in preview, then save your PDF and close the report, like: Do Until .EOF = True DoCmd.OpenReport "Performance Plan", acPreview, , "ID =" & rs!ID DoCmd.OutputTo acOutputReport, "Performance Plan", acFormatPDF, "PATH\" & strEMPID & ".pdf"...
  17. P

    One primary key to multiple foreign keys in the same table?

    Why not, just insert the table a second time in the relations window and create the secon link to that duplicate table
  18. P

    Passing parameters in a QueryDef by using prgram code

    You can't run a parameter query from VBA. Construct the query on the fly like: Dim strSQL as String Dim Db As DAO.Database Dim rst As DAO.Recordset strSQL = "SELECT tblVL.Id_VL, tblVL.Id_Product, tblVL.Date_VL, tblVL.VL FROM tblVL " & _ "WHERE (((tblVL.Date_VL)>= #" & me.Fees_Start_Date " & #...
  19. P

    Trouble with a formula and named ranges

    Your code errors because you are trying to convert a string to a number. DeclineV = "=-LN(1-((LOGEST((yval),(xval))-1)*365))" Dim tempV As Variant tempV = CDbl(DeclineV) DeclineV is a string with the value in red, cDbl can't do anything with it.
  20. P

    Combobox opens a different form

    Thats because you open de form in append mode, change the openform line to: DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormEdit
Back
Top Bottom