-
WSpieter
AskWoody Loungerassuming 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;
-
WSpieter
AskWoody Loungeryou’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!
-
WSpieter
AskWoody Loungerthanks 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. -
WSpieter
AskWoody Loungerdoes application.DisplayAlerts=wdAlertsNone help?
-
WSpieter
AskWoody LoungerEdited by HansV to change [script] tags to tags. Please don't use Script - it makes code unreadable
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 FormFieldFor Each aFormField In ActiveDocument.FormFields
Debug.Print aFormField.Name
FormFieldNames = (FormFieldNames & aFormField.Name & vbCrLf)
Next
Documents.Add.Range.Text = FormFieldNames
End Sub -
WSpieter
AskWoody Loungerthe 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.
-
WSpieter
AskWoody Loungerdo you have a before close event running?
-
WSpieter
AskWoody LoungerMay 15, 2005 at 4:20 pm in reply to: Word version dependent VBA code (Word 2000 / Word 2002) #947765the .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.
-
WSpieter
AskWoody Loungerno, 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.
-
WSpieter
AskWoody Loungerreverse 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.)
-
WSpieter
AskWoody Loungerjust 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.
-
WSpieter
AskWoody LoungerNovember 11, 2004 at 10:17 am in reply to: inputbox that shows formula & edit formula purpose (excel 2002) #898451you 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.
-
WSpieter
AskWoody LoungerNovember 11, 2004 at 10:17 am in reply to: inputbox that shows formula & edit formula purpose (excel 2002) #898452you 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.
-
WSpieter
AskWoody LoungerOctober 14, 2004 at 7:27 pm in reply to: test if Word document is already open in VB (Word 2000) #1815329whether 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.
-
WSpieter
AskWoody Loungertough 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.
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
A CVE-MITRE-CISA-CNA Extravaganza
by
Nibbled To Death By Ducks
3 hours, 49 minutes ago -
Sometimes I wonder about these bots
by
Susan Bradley
7 minutes ago -
Does windows update component store “self heal”?
by
Mike Cross
16 hours, 47 minutes ago -
Windows 11 Insider Preview build 27858 released to Canary
by
joep517
17 hours, 47 minutes ago -
Pwn2Own Berlin 2025: Day One Results
by
Alex5723
17 hours, 12 minutes ago -
Windows 10 might repeatedly display the BitLocker recovery screen at startup
by
Susan Bradley
13 hours, 42 minutes ago -
Windows 11 Insider Preview Build 22631.5409 (23H2) released to Release Preview
by
joep517
20 hours, 29 minutes ago -
Windows 10 Build 19045.5912 (22H2) to Release Preview Channel
by
joep517
20 hours, 30 minutes ago -
Kevin Beaumont on Microsoft Recall
by
Susan Bradley
9 hours, 4 minutes ago -
The Surface Laptop Studio 2 is no longer being manufactured
by
Alex5723
1 day, 4 hours ago -
0Patch, where to begin
by
cassel23
22 hours, 39 minutes ago -
CFPB Quietly Kills Rule to Shield Americans From Data Brokers
by
Alex5723
1 day, 18 hours ago -
89 million Steam account details just got leaked,
by
Alex5723
1 day, 6 hours ago -
KB5058405: Linux – Windows dual boot SBAT bug, resolved with May 2025 update
by
Alex5723
2 days, 2 hours ago -
A Validation (were one needed) of Prudent Patching
by
Nibbled To Death By Ducks
1 day, 17 hours ago -
Master Patch Listing for May 13, 2025
by
Susan Bradley
1 day, 4 hours ago -
Installer program can’t read my registry
by
Peobody
1 hour, 52 minutes ago -
How to keep Outlook (new) in off position for Windows 11
by
EspressoWillie
1 day, 15 hours ago -
Intel : CVE-2024-45332, CVE-2024-43420, CVE-2025-20623
by
Alex5723
1 day, 22 hours ago -
False error message from eMClient
by
WSSebastian42
2 days, 13 hours ago -
Awoke to a rebooted Mac (crashed?)
by
rebop2020
2 days, 23 hours ago -
Office 2021 Perpetual for Mac
by
rebop2020
3 days ago -
AutoSave is for Microsoft, not for you
by
Will Fastie
2 hours, 48 minutes ago -
Difface : Reconstruction of 3D Human Facial Images from DNA Sequence
by
Alex5723
3 days, 3 hours ago -
Seven things we learned from WhatsApp vs. NSO Group spyware lawsuit
by
Alex5723
11 hours, 10 minutes ago -
Outdated Laptop
by
jdamkeene
3 days, 9 hours ago -
Updating Keepass2Android
by
CBFPD-Chief115
3 days, 14 hours ago -
Another big Microsoft layoff
by
Charlie
3 days, 14 hours ago -
PowerShell to detect NPU – Testers Needed
by
RetiredGeek
16 hours, 23 minutes ago -
May 2025 updates are out
by
Susan Bradley
18 hours, 5 minutes ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.