-
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.
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
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
-
OTF, which backs Tor, Let’s Encrypt and more, sues to save its funding
by
Nibbled To Death By Ducks
1 hour, 58 minutes ago -
El Canal Maritimo (Awaiting moderation)
by
lourdespinson24
2 hours, 54 minutes ago -
Select multiple emails and they all open up! (Awaiting moderation)
by
CeeJay
8 hours, 17 minutes ago -
How to remove an update preview (Awaiting moderation)
by
Gunny
10 hours, 8 minutes ago -
Updating Windows 10 to Windows 11: 23H2 or 24H2?
by
Still Anonymous
12 hours, 42 minutes ago -
How can I update “Explorer Patcher”
by
WSplanckster
14 hours, 35 minutes ago -
Check out the home page for Signal
by
CAS
12 hours, 27 minutes ago -
Windows 11 and Trial version of MS Office
by
Tex265
11 hours, 30 minutes ago -
Windows 11 Insider Preview build 26120.3585 (24H2) released to BETA
by
joep517
18 hours, 58 minutes ago -
Windows 11 Insider Preview build 26200.5510 released to DEV
by
joep517
19 hours, 2 minutes ago -
Windows 11 Insider Preview Build 26100.3624 (24H2) released to Release Preview
by
joep517
19 hours, 5 minutes ago -
Limits on User Names
by
CWBillow
15 hours, 48 minutes ago -
MS-DEFCON 4: Mixed bag for March
by
Susan Bradley
9 hours, 51 minutes ago -
Non Apple Keyboards
by
pmcjr6142
48 minutes ago -
How to delete your 23andMe data – The Verge
by
AJNorth
13 hours, 45 minutes ago -
7 common myths about Windows 11 (Microsoft AD)
by
EyesOnWindows
11 hours, 21 minutes ago -
Error updating to Win11 0x8024a205
by
bmeacham
1 day, 13 hours ago -
default apps
by
chasfinn
1 day, 12 hours ago -
Will MS Works 4 work in MS Win 11?
by
MileHighFlyer
1 day, 20 hours ago -
Adding links to text in Word 2000
by
sgeneris
18 hours, 1 minute ago -
FBI warnings are true—fake file converters do push malware
by
Nibbled To Death By Ducks
1 day, 14 hours ago -
Classic and Extended Control Panel — no need to say goodbye
by
Deanna McElveen
16 hours, 44 minutes ago -
Things you can do in 2025 that you couldn’t do in 2024
by
Max Stul Oppenheimer
2 days, 1 hour ago -
Revisiting Windows 11’s File Explorer
by
Will Fastie
1 day, 10 hours ago -
Planning ahead for migration
by
Susan Bradley
10 hours, 36 minutes ago -
Yahoo mail getting ornery
by
Tom in Az
1 day, 13 hours ago -
Is Spectrum discontinuing email service?
by
Peobody
1 day, 16 hours ago -
Practice what you preach! A cautionary tale.
by
RetiredGeek
1 day, 13 hours ago -
Looking for Microsoft Defender Manuals/Tutorial
by
blueboy714
1 day, 17 hours ago -
Win 11 24H2 Home or Pro?
by
CWBillow
1 day, 13 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.