-
WSClausParkhoi
AskWoody LoungerBy the way. Why don’ t you consider using a combobox as a substitute for the txtBox and the publishers listbox? I have attached a small sample (ver. 97)
-
WSClausParkhoi
AskWoody LoungerI would have created a registration form based on the class table (tblClass?) and a subform based on tblClassRegistrations. In the subform (or even in the tabledefinition for tblClassRegistrations) select the individual to register via a combobox. No VB coding needed.
If for some reason you don’t want to do that, something like this should work:
Assumptions:
The bound column in lstBoxB has the StudentID.
StudentID is defined in the tblClassRegistrations table.
The primary key in tblClassRegistrations is an autonumber (e.g. RegistrationID).
The name of the ClassID control on the form is txtClassID.Create a DoubleClick event in listbox B having the following code:
Private Sub lstBoxB_DblClick(Cancel As Integer)
on Error goto ErrHdl
dim rst as recordset
set rst=currentdb.openrecordset(“tblClassRegistrations”)
rst.add
rst!ClassID=txtClassID
rst!StudentID=lstBoxB ‘ Assume Student is the bound column
rst.update
rst.close
lstBoxA.Requery ‘ Update the list of reg’ed students
Xit:
exit sub
ErrHdl:
msgbox Err.description
resume Xit
End Sub -
WSClausParkhoi
AskWoody LoungerIn order for you to use the Click event you must set the value of the listbox – selecting the correct row is not sufficient.
-
WSClausParkhoi
AskWoody LoungerHow did you code the textbox and the first listbox together ? And how do you move down the publishers listbox ?
-
WSClausParkhoi
AskWoody LoungerWhy are you talking about default values?
To make it work you would have to use the textbox AfterUpdate event to assign a value to the publishers listbox corresponding to the publisher, and then call the Click event (publishers listbox) in order to fill the publications listbox, assuming you are using this to fill the publications listbox. -
WSClausParkhoi
AskWoody LoungerJanuary 14, 2002 at 3:02 pm in reply to: detect the Access version of a database programati (Access 97/2000) #563667CurrentDb.Properties(“AccessVersion”) will return the Acces version (not the Office version).
-
WSClausParkhoi
AskWoody LoungerYou may want to place the DoCmd.Maximize stmt right after your DoCmd.OpenReport. Then you don’t have to put code in the report.
-
WSClausParkhoi
AskWoody LoungerThe very simple solution to your problem would be to create a PreviousPrice field (and may be even a DateChanged field) in your products table and copy the price on every change.
A more advanced solution could be to create and maintain a separate ProductPriceHistory table. -
WSClausParkhoi
AskWoody LoungerJanuary 11, 2002 at 10:48 pm in reply to: Need guidance autolinking tables (Office 97 SR2 win98) #563257To my understanding you have already established the 12 mmmyyProj dbs initialy having empty tables and in addition you have established a yyProj dbs.
Assuming you have established links to the 12 mmmyyProj dbs tables in the yyProj dbs, all you have to do is to create a UNION query in the yyProj dbs in order to combine your monthly results. Then you do not have to worry about who will append data and when. The result will always be uptodate (uptomonth).
As for Excel: bring your data into a sheet using a query. Create a query in Excel referencing the above mentioned query in the yyProj dbs.
As I see it, you don’t have to do any VB programming in Excel or Access to do this job. -
WSClausParkhoi
AskWoody LoungerTry vbNewline for size
I have two public constants always declared in my applications:
Public Const cNl = vbNewLine
Public Const c2Nl = cNl & cNlThey are easier to type (if used often).
-
WSClausParkhoi
AskWoody LoungerPeter,
I have spent some time solving your problem, and now find that you have managed your self. Congratulatins!
I decided to post this anyway, since some of it might have your interest.Regards,
Claus ParkhoiHere it is:
I have done some changes to your code. The use of CentimetersToPoints was the
cause of your trouble. I have changed all refs to: appWd.CentimetersToPoints(x).
Furthermore I have made changes to attempt to use a running Wordapp by using
Getobject instead of Createobject. If Word is not running, Err_Tryword will
create the object for you and resume. This makes your function IsWordRunning
redundant.
I have tested it. It works. Happy New Year!
PS. Why don’t you put appWD declaration in the sub – I would have.Public appWD As Word.Application ‘In the real code this is actually declared elsewhere
Sub TryWord()
Dim StrToInsert As String, FileName As String, Msg As String
Dim blnWordWasRunning As Boolean
Dim FlDt As Date
On Error GoTo Err_TryWord
‘ ** remove blnWordWasRunning = IsWordRunning
‘ ** remove Set appWD = CreateObject(“Word.Application”)
‘ ** remove blnWordWasRunning = IsWordRunning
‘ insert next line
Set appWD = GetObject(, “Word.Application”) ‘ Use existing app, if any
FileName = “C:AAATemp.rtf”
With appWD
.Application.Visible = False
.Documents.Add DocumentType:=wdNewBlankDocument
With .Selection
.Font.Name = “Arial”
.Font.Size = 10
StrToInsert = “Hope This works”
.InsertAfter StrToInsert
End With ‘.Selection
With .ActiveDocument.PageSetup
.Orientation = wdOrientLandscape
.TopMargin = appWD.CentimetersToPoints(2)
.BottomMargin = appWD.CentimetersToPoints(1.5)
.LeftMargin = appWD.CentimetersToPoints(2)
End With ‘ActiveDocument.PageSetup
.Selection.ParagraphFormat.TabStops.ClearAll
.ActiveDocument.DefaultTabStop = appWD.CentimetersToPoints(1.27)
.Selection.ParagraphFormat.TabStops.Add Position:=appWD.CentimetersToPoints(2), _
Alignment:=wdAlignTabLeft, Leader:=wdTabLeaderSpaces
On Error Resume Next
FlDt = FileDateTime(FileName)
If Err.Number = 0 Then
On Error GoTo Err_TryWord
Msg = FileName & vbCrLf & “already exists.” & vbCrLf & _
“Overwrite – [Yes] or save as Temp.rtf – [No}”
If MsgBox(Msg, vbQuestion + vbYesNo) = vbNo Then
FileName = “C:AAATemp2.rtf”
End If
End If
On Error GoTo Err_TryWord
.ActiveDocument.SaveAs FileName:=FileName, FileFormat:=wdFormatRTF
.ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges
‘ ** you might remove the next line, since calling again
.Quit
End With ‘appWD
Set appWD = Nothing
FollowHyperlink FileName
Exit_TryWord:
‘ ** remove the following lines
‘If blnWordWasRunning = False Then ‘| If word wasn’t already running
‘Do ‘| I
![]() |
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
-
My Simple Word 2010 Macro Is Not Working (Awaiting moderation)
by
mbennett555
6 hours, 56 minutes ago -
Office gets current release
by
Susan Bradley
11 hours, 40 minutes ago -
FBI: Still Using One of These Old Routers? It’s Vulnerable to Hackers
by
Alex5723
1 day, 4 hours ago -
Windows AI Local Only no NPU required!
by
RetiredGeek
12 hours, 43 minutes ago -
Stop the OneDrive defaults
by
CWBillow
1 day, 5 hours ago -
Windows 11 Insider Preview build 27868 released to Canary
by
joep517
1 day, 14 hours ago -
X Suspends Encrypted DMs
by
Alex5723
1 day, 17 hours ago -
WSJ : My Robot and Me AI generated movie
by
Alex5723
1 day, 17 hours ago -
Botnet hacks 9,000+ ASUS routers to add persistent SSH backdoor
by
Alex5723
1 day, 18 hours ago -
OpenAI model sabotages shutdown code
by
Cybertooth
1 day, 18 hours ago -
Backup and access old e-mails after company e-mail address is terminated
by
M W Leijendekker
1 day, 6 hours ago -
Enabling Secureboot
by
ITguy
1 day, 13 hours ago -
Windows hosting exposes additional bugs
by
Susan Bradley
2 days, 2 hours ago -
No more rounded corners??
by
CWBillow
1 day, 22 hours ago -
Android 15 and IPV6
by
Win7and10
1 day, 12 hours ago -
KB5058405 might fail to install with recovery error 0xc0000098 in ACPI.sys
by
Susan Bradley
2 days, 14 hours ago -
T-Mobile’s T-Life App has a “Screen Recording Tool” Turned on
by
Alex5723
2 days, 17 hours ago -
Windows 11 Insider Preview Build 26100.4202 (24H2) released to Release Preview
by
joep517
2 days, 12 hours ago -
Windows Update orchestration platform to update all software
by
Alex5723
3 days ago -
May preview updates
by
Susan Bradley
2 days, 12 hours ago -
Microsoft releases KB5061977 Windows 11 24H2, Server 2025 emergency out of band
by
Alex5723
2 days, 3 hours ago -
Just got this pop-up page while browsing
by
Alex5723
2 days, 17 hours ago -
KB5058379 / KB 5061768 Failures
by
crown
2 days, 14 hours ago -
Windows 10 23H2 Good to Update to ?
by
jkitc
1 day, 16 hours ago -
At last – installation of 24H2
by
Botswana12
3 days, 16 hours ago -
MS-DEFCON 4: As good as it gets
by
Susan Bradley
14 hours, 12 minutes ago -
RyTuneX optimize Windows 10/11 tool
by
Alex5723
4 days, 4 hours ago -
Can I just update from Win11 22H2 to 23H2?
by
Dave Easley
2 days, 3 hours ago -
Limited account permission error related to Windows Update
by
gtd12345
4 days, 18 hours ago -
Another test post
by
gtd12345
4 days, 18 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.