-
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, but widespread attacks make patching prudent. Go ahead and patch, but watch out for potential problems. |
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
-
Proton to drop prices after ruling against “Apple tax”
by
Cybertooth
3 hours, 12 minutes ago -
24H2 Installer – don’t see Option for non destructive install
by
JP
3 hours, 38 minutes ago -
Asking Again here (New User and Fast change only backups)
by
thymej
14 hours, 33 minutes ago -
How much I spent on the Mac mini
by
Will Fastie
4 hours ago -
How to get rid of Copilot in Microsoft 365
by
Lance Whitney
6 hours, 21 minutes ago -
Spring cleanup — 2025
by
Deanna McElveen
20 hours, 25 minutes ago -
Setting up Windows 11
by
Susan Bradley
4 hours, 1 minute ago -
VLC Introduces Cutting-Edge AI Subtitling and Translation Capabilities
by
Alex5723
15 hours, 53 minutes ago -
Powershell version?
by
CWBillow
16 hours, 46 minutes ago -
SendTom Toys
by
CWBillow
1 hour, 2 minutes ago -
Add shortcut to taskbar?
by
CWBillow
20 hours, 41 minutes ago -
Sycophancy in GPT-4o: What happened
by
Alex5723
1 day, 13 hours ago -
How can I install Skype on Windows 7?
by
Help
1 day, 11 hours ago -
Logitech MK850 Keyboard issues
by
Rush2112
18 hours, 41 minutes ago -
We live in a simulation
by
Alex5723
2 days, 3 hours ago -
Netplwiz not working
by
RetiredGeek
1 day, 13 hours ago -
Windows 11 24H2 is broadly available
by
Alex5723
2 days, 15 hours ago -
Microsoft is killing Authenticator
by
Alex5723
1 day, 3 hours ago -
Downloads folder location
by
CWBillow
2 days, 22 hours ago -
Remove a User from Login screen
by
CWBillow
1 day, 17 hours ago -
TikTok fined €530 million for sending European user data to China
by
Nibbled To Death By Ducks
2 days, 13 hours ago -
Microsoft Speech Recognition Service Error Code 1002
by
stanhutchings
2 days, 13 hours ago -
Is it a bug or is it expected?
by
Susan Bradley
15 hours, 20 minutes ago -
Image for Windows TBwinRE image not enough space on target location
by
bobolink
2 days, 12 hours ago -
Start menu jump lists for some apps might not work as expected on Windows 10
by
Susan Bradley
1 day, 11 hours ago -
Malicious Go Modules disk-wiping malware
by
Alex5723
3 days, 2 hours ago -
Multiple Partitions?
by
CWBillow
3 days, 2 hours ago -
World Passkey Day 2025
by
Alex5723
35 minutes ago -
Add serial device in Windows 11
by
Theodore Dawson
4 days, 11 hours ago -
Windows 11 users reportedly losing data due forced BitLocker encryption
by
Alex5723
2 days, 12 hours 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.