• WSpieter

    WSpieter

    @wspieter

    Viewing 15 replies - 1 through 15 (of 214 total)
    Author
    Replies
    • in reply to: Query to show only duplicate records (2003) #1103467

      assuming your tabel is called table1 and the field is called field1, the following SQL statement should do it:

      SELECT DISTINCT table1.field1 FROM table1 INNER JOIN (SELECT field1 FROM table1 GROUP BY field1 HAVING COUNT (*) >1) as Tbl1 ON table1.field1 =Tbl1.field1;

    • in reply to: subsubform within tabcontrol (2002) #1102956

      you’re a great help as always Hans!

      i’ve got it working now, but only if the name property and source object property of the subfrom control are the same.
      so if i set both name property and source object to subfrmGlobal, =[subfrmGlobal]![txtDetailID] in txtLink as source control works, and this can then be used as the master field link for my subsubform on page 2.

      if i set name property to ctrlsubfrmGlobal and source object to to subfrmGlobal, neither suggestion seems to work.

      thanks!

    • in reply to: subsubform within tabcontrol (2002) #1102953

      thanks Hans!

      that should do the trick. however, i am more versed in VBA than in form design unfortunately and i’m having difficulty applying the “=[SubFormName]![IDName]”-suggestion to the actual situation.
      in vba it’s the control forms(0).Controls(“ctrlsubfrmGlobal”).controls(18).name i want to set as control source to the txtLink textbox you proposed.

      for clarity i have given the forms and the subformcontrols in which they are contained different names.
      so the subform for table2 named subfrmGlobal is contained in the control named ctrlsubfrmGlobal wich sits in page1 of the main form (=forms(0)).
      i tried =subfrmGlobal!txtDetailID without avail (getting a #name? error in txtLink control)

      should i explicitly reference both controls and forms in the source control?
      but something like =[ctrlsubfrmGlobal]!Forms!subfrmGobal!txtDetailID does not work either.

    • in reply to: Word has insufficient memory (Word 2002 XP) #1042277

      does application.DisplayAlerts=wdAlertsNone help?

    • in reply to: For Each Field in a Form (Office 2003) #1033914

      Edited by HansV to change [script] tags to tags. Please don't use Script - it makes code unreadable cheers Hans, i just was a little bit rusty as you might have guessed.

      the following code will create a new document with all the field names in case you are talking about form fields on a document. it will also list the names in the direct window (CTRL+G in the VB editor.)

      Sub ListFormfields()
      Dim FormFieldNames As String
      Dim aFormField As FormField

      For Each aFormField In ActiveDocument.FormFields
      Debug.Print aFormField.Name
      FormFieldNames = (FormFieldNames & aFormField.Name & vbCrLf)
      Next
      Documents.Add.Range.Text = FormFieldNames
      End Sub

    • in reply to: Excel row insert (Excel 2002) #1033912

      the appropriate constant to use in this case is called xlShiftDown (member of the XlInsertShiftDirection constants), with a value of -4121. the xlDown constant will also work, because it has the same value, but this one is more used to indicate direction when moving from or to a certain range or expanding it.

      the statement you used is equivalent to selection.insert shift:=0, since the x1down constant does not exist, unless you defined it yourself. since its value does not correspond to one of the insertshiftdirection constants, the insert method will revert to its default behavior and shift cells according to the shape of the range.

      these types of syntax errors can be catched easily by using the ‘option explicit’ directive on top of the module. when you compile the module, the error will be signaled.

    • in reply to: VBA code no longer works :o) (Word 2002 /XP SP3) #1033905

      do you have a before close event running?

    • the .Borders(wdBorderDiagonalDown) is actually not a good example of your problem, because then the compile error could easily be avoided by replacing the constant name with its value. the compile problem would only arise if you need to use a specific word 2002 method property or parameter name.

    • in reply to: Detecting file/folder permissions (VB6) #929268

      no, you have to write it with the standard open, print, close what have you staments or the file system object. then you can test silently for access denied. then write the actual file using the api.

    • in reply to: Using Office Automation from Java #929263

      reverse engineer java JNI?
      or
      http://j-integra.intrinsyc.com/com/download/%5B/url%5D

      (you have to contact them though for licencing fees, evaluation period is free.)

    • in reply to: Detecting file/folder permissions (VB6) #929254

      just try to write a small dummy text file to test for proper access rights. then depending on the result, abort or continue with the actual file you want to write.

    • you can go into edit mode by pressing F2. if you want this to be the standard behavior of the inputbox, you could try sending the f2 key with the vba.sendkeys method before you call the inputbox, but i don’t know (and haven’t tried) if this would work.

    • you can go into edit mode by pressing F2. if you want this to be the standard behavior of the inputbox, you could try sending the f2 key with the vba.sendkeys method before you call the inputbox, but i don’t know (and haven’t tried) if this would work.

    • in reply to: test if Word document is already open in VB (Word 2000) #1815329

      whether the template is on a server or not should not matter. if you start a document from a (server)template with set mydoc=documents.add(“myserverdocsmytemplate.dot”), you should not receive the error. still, if you’re using the open method instead, you can include additional parameters that will prevent the warning from appearing.

    • in reply to: Word mail merge failure (Word 2000 / Access 2000) #858580

      tough problem. it looks like something is corrupting the registry.
      you might want to try the following (make sure no instances of word are running – if you’re not sure, reboot the computer)
      now click start->run and enter “winword /r” (according to mskb the switch for word2000 is /r (and not /regserver)) without the quotes and press enter. this will reregister word’s automation classes.
      also, iirc, the ‘set x=new “classname”‘ construct bypasses some stages in the creation of a class instance, so your problem could possibly be solved by using a
      dim loWd as word.application
      Set loWd = createobject(“word.application”)
      note:you can still use early binding for this statement and all your other statements if you leave the reference to the word object library.

    Viewing 15 replies - 1 through 15 (of 214 total)