-
WSlesoch
AskWoody LoungerI felt a little embarrassed that you printed only once (1 or 2 pages depending on page setup I supposed). I tried it again and this is what I found:
Set CBarCtl = CBar.Controls.Add(Type:=msoControlButton)
With CBarCtl
.Caption = “Cetak”
.Style = msoButtonIcon
.TooltipText = “Mencetak maklumat yang dipaparkan”
(1) .OnAction = “=CetakLapor()”
(2) ‘ .OnAction = “=DoCmd.PrintOut”
.FaceId = 4
End WithFunction CetakLapor()
(3) DoCmd.PrintOut acPages, 1
(4) ‘ DoCmd PrintOut
End FunctionIf I use line (1) and disable line (2), the printer only prints once irrespective of whether line (3) or line (4) is used.
If I disable line (1) and activate line (2), then the printer would print the report 3 times. Why?My sincere thanks for looking into my codes, Charlotte.
-
WSlesoch
AskWoody LoungerI send the attached database again.
-
WSlesoch
AskWoody LoungerIn trying to extract the portions of my program that prints the report, and then running the extracted database, I discovered a solution to my problem. In my codes, there is a command bar in the menu that print the active report using the code :
DoCmd.PrintOut
By default it prints all the pages in the report. I changed it to print only one page:
DoCmd.PrintOut acPages, 1
Now my program prints only a single page of the report. But I am still puzzled why DoCmd.PrintOut print out three pages of the same report. The error could be in my query or reports.
I send the extracted database over (Print3.mdb) with some data in the table in case you need it. Sorry that most of the user’s codes are in the native language. The report is about statistics of students of different ethnicity in different classes and of different years of studies.
-
WSlesoch
AskWoody LoungerYes, I am the only one using the database so far. It hasn’t seen the light outside my desktop yet. Both the front- and back-end of the database are in the local computer. Essentially I worked in a non-networked environment during the codes and interface writing stage.
The records with bad autonumber do have memo fields – but what is the relationship between the error and memo fields?As far as I can recall, the desktop I am using suffers no crashes during the developmental stage of my database. Unlikely the record pointer wasn’t updated by the computer because of crashes.
As you suggested, I will go back to my codes again. My back-end database has a main table related to another two tables, with the autonumber as the primary connecting key. In the codes, the three tables are related using SQL. This could be the cause of error since you mentioned it.
I really hope the error is in my codes else my confidence in Access would be dented.
-
WSlesoch
AskWoody LoungerYes, I have 1302 records in the table of my sample database. The table has autonumber ID. It is a split file, called by a main database file. I didn’t compact/repair the sample database often during testing. (But I did run Compact/Repair database after I discovered the error, but the error persisted even after compact/repair.) When I said the new record was 787 instead of 1302, I meant the record pointer (?) was reset to 787 instead of the expected 1302 for new record. As for whether all my MS Office components were SR1, I access Help->About Microsoft windows for all my Office components, they show version 9.0.4402 SR-1. This is the only clue that I have to indicate my Office is of SR-1 version.
Initially I never expected the error to occur as I suspected something wrong with my codes (which ran correctly before the error). With the error, I couldn’t go to a new record. After hours of modifying my codes without success, then it only dawned on me to check the table in the split database. That was the moment of truth.
-
WSlesoch
AskWoody LoungerI think Charlotte is right – there is no way to make A2K forms IME-aware. Microsoft had only in mind to make IME a word-processing adjunct to Word for East Asian Language input and making A2K forms respond to IME was just too much trouble.
I manage to find a convoluted solution to my own problem – input Chinese characters in English A2K forms. I used a Chinese front processors called Chinese Star 2001 (which is compatible with MS Office 2K) made by a company in China and marketed by SunTendy America Inc. Here are the procedures I used for those who are interested:
(1) Run Chinese Star 2001 (CStar) first before A2K.
(2) Start A2K and activate a form in design view. In the properties pop-up of the control boxes, an additional property called IME Mode will be inserted. The IME mode has three options : No Control, IME ON, IME OFF. Just leave the property with the default option – No Control. I suspect the IME on/off properties can be used in VBA codes. But since CStar has to be in memory before Chinese characters can be entered, I see no necessity to incorporate it in codes. More importantly, incorporating these properties in codes will halt A2K when CStar isn’t running in the background.
(3) Since I need to input Chinese names, I use a textbox to get user’s input. CStar comes with many nice fonts which are not displayable once CStar is exited. Hence I don’t use any of the CStar fonts supplied. Instead I choose the MS Song font (mssong.tff) by Microsoft (used by IE5 to display web sites using Simplified Chinese), which supports code page 936 : Simplified Chinese characters for PRC & Singapore, and which is displayable by CStar too. In this way, I can view Chinese characters together with other English input in the same A2K form without CStar. Note that CStar is still needed for Chinese characters input.
Any caveat? So far there is one. If CStar is running and a controlbox with date input is edited, it will automatically be displayed in the traditional yy/mm/dd Chinese calendar format. However, if no editing is done or if CStar isn’t running, the date format displayed follows the input mask or the format() in codes. I wonder if anyone has any idea how I can make the displayed date different from the yy/mm/dd format forced upon the user by CStar.
I understand there are many other Chinese/Japanese/Korean (CJK) front processors available, like UnionWay and TwinBridge (by US companies), and NJStar (by an Australian company). I have only experimented only with CStar 2001 and it fulfills my need, albeit in a round-about way.
My sincere thanks to Charlotte, WendelB and MarkJ for giving me pointers in searching for a solution to my problem.
-
WSlesoch
AskWoody LoungerI can’t recall where did I read this, or if what I read was meant for A2K or A2002. But I remembered reading that internally VBA represents every string in Unicode format, and has to convert the string to ANSI if Unicode isn’t used. That caused me make the statement that MSO 2K can understand Unicode.
-
WSlesoch
AskWoody LoungerMy requirement is very “simple”. I want to set up a textbox in Access whereby when it is in focus, the IME is automatically turned on for input of East Asian characters (names of customers in Chinese), and when it loses its focus, the IME is disabled, and normal input in English is enabled. I read that MSO 2K understands unicode, I thought it is a matter of tweaking before one can input East Asian characters in its testbox. Thanks for your reply.
-
WSlesoch
AskWoody LoungerSeptember 2, 2002 at 8:44 pm in reply to: ChangeStartupProperties not working in MDE (A2K SR1) #613376I discovered by accident and after several trials that the MDE does change its startup properties as dictated by the conditional compilation – the MDE has to be bypassed by using Shift, and then allowed to run the program once before the changed startup properties can be activated. I don’t know why it behaved this way. If the MDE was run immediately it was made and after exiting from Access, the startup properties weren’t changed as expected from the conditional compilation.
I forgot to mention – the sub ChangeProperty() was extracted from the VBA Help file.
-
WSlesoch
AskWoody LoungerAugust 30, 2002 at 2:13 pm in reply to: ChangeStartupProperties not working in MDE (A2K SR1) #612840I used the compiler directive as it was suggested in the Help file
It worked when I wanted to change from docmd.close (#Const conVersiMDE = False) in MDB to docmd.quit when I made it into a MDE (#Const conVersiMDE = True). I was using a const before I used #const. Both worked well.
-
WSlesoch
AskWoody LoungerAugust 30, 2002 at 2:06 pm in reply to: ChangeStartupProperties not working in MDE (A2K SR1) #612838I deleted the conditional compiler directive and just left the codes like belows:
—————————–
Sub SetStartupProperties()Const DB_Text As Long = 10
Const DB_Boolean As Long = 1ChangeProperty “AllowShortcutMenus”, DB_Boolean, False
ChangeProperty “AllowBuiltinToolbars”, DB_Boolean, False
ChangeProperty “AllowFullMenus”, DB_Boolean, False
ChangeProperty “AllowSpecialKeys”, DB_Boolean, False
ChangeProperty “AllowBypassKey”, DB_Boolean, False
Application.VBE.MainWindow.Visible = FalseEnd Sub
———————————Still the Startup properties didn’t change, and the Shift bypass key happily displayed my database windows on startup and the shortcut menu could be popped up by right-clicking.
I am curious why it works in MDB and not in MDE. Is it my mistake or a designed feature of A2K
?
-
WSlesoch
AskWoody LoungerBased on the lead given by HansV, I imported the modules basRegistry and basCommon from Chapter 17 of the book “Access 2002 Desktop Developer’s Handbook” by Litwin, Getz, and Gunderloy (Sybex 2001) to change the key data of the key value “A.hlp” of subkey “SoftwareMicrosoftWindowsHelp” of the root key HKEY_LOCAL_MACHINE. (The codes work in A2K as well as A2002.)
When my program starts, it checks if A.hlp is in the mdb directory. If it is, then it will access the registry HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsHelp to look for the key value A.hlp to check if the key data is the same as the directory of the mdb. If it is, then exit sub; else modify the key data to that of the mdb directory. If A.hlp isn’t in the same same diretory of the mdb file, then nothing is done as it is possible that the help file A.hlp could be in the Access default directory and the user installed the mdb somewhere else.
The scheme works. Now the mdb and the associated help file can be moved to anywhere and still the user is able to access the help file by menu or by F1 short-cut. Just to be sure, is there any caveat that I am not aware of to the scheme above?
Still I think the scheme above is an overkill just to make sure the mdb and the hlp files can be moved together anyway in the desktop without the alarming “The file help is not available” message to an unsuspected user. Does anyone has a simpler way of achieving the same thing?
-
WSlesoch
AskWoody LoungerThanks HansV. I understand the first part when I looked at the Helpfile property of my forms/reports. I personally put it there myself without realizing that is how Access knows the name of my help file.
The second part still puzzles though. I actually use Application.CurrentProject.Path plus the help file name in
With obj
hWnd = .hWnd
strHelpFile = Application.CurrentProject.Path & “” & “A.HLP”
lngContext = .HelpContextId
End WithWhen I move the help file and the Access mdb together to another folder, my program can access the help file when ShowHelpAPI() is directly called. The problem is that the help key F1 cannot access the help file anymore (which it did in its original location). I suppose when F1 is pressed, Access looks into the folder of the original help file in the registry. Am I right? Is there any other method where the help shortcut F1 can recognise the new location of my help file as indicated in Application.CurrentProject.Path & “” & “A.HLP”
without resorting to Regedit? I think it is a bad design on the part of Windows if I have to resort to editing the registry just to access the help file when it is moved to another location. -
WSlesoch
AskWoody LoungerI agree with you Douglas, and reliability or the lack of it in using CurDir() caused me intermittent problem.
-
WSlesoch
AskWoody LoungerThanks Dottie. I use Application.CurrentProject.Path to get the path to the database.Thanks too to Tim and Charlotte for helping me.
![]() |
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
-
Global data centers (AI) are driving a big increase in electricity demand
by
Kathy Stevens
3 hours, 38 minutes ago -
Office apps read-only for family members
by
b
6 hours, 14 minutes ago -
Defunct domain for Microsoft account
by
CWBillow
3 hours, 6 minutes ago -
24H2??
by
CWBillow
1 hour, 12 minutes ago -
W11 23H2 April Updates threw ‘class not registered’
by
WindowsPersister
15 hours ago -
Master patch listing for April 8th, 2025
by
Susan Bradley
8 hours, 13 minutes ago -
TotalAV safety warning popup
by
Theodore Nicholson
3 hours, 3 minutes ago -
two pages side by side land scape
by
marc
2 days, 4 hours ago -
Deleting obsolete OneNote notebooks
by
afillat
2 days, 6 hours ago -
Word/Outlook 2024 vs Dragon Professional 16
by
Kathy Stevens
1 day, 9 hours ago -
Security Essentials or Defender?
by
MalcolmP
1 day, 11 hours ago -
April 2025 updates out
by
Susan Bradley
6 hours, 44 minutes ago -
Framework to stop selling some PCs in the US due to new tariffs
by
Alex5723
1 day, 5 hours ago -
WARNING about Nvidia driver version 572.83 and 4000/5000 series cards
by
Bob99
19 hours, 12 minutes ago -
Creating an Index in Word 365
by
CWBillow
1 day, 21 hours ago -
Coming at Word 365 and Table of Contents
by
CWBillow
9 hours, 46 minutes ago -
Windows 11 Insider Preview Build 22635.5170 (23H2) released to BETA
by
joep517
3 days, 1 hour ago -
Has the Microsoft Account Sharing Problem Been Fixed?
by
jknauth
3 days, 4 hours ago -
W11 24H2 – Susan Bradley
by
G Pickerell
3 days, 6 hours ago -
7 tips to get the most out of Windows 11
by
Alex5723
3 days, 4 hours ago -
Using Office apps with non-Microsoft cloud services
by
Peter Deegan
2 days, 21 hours ago -
I installed Windows 11 24H2
by
Will Fastie
1 day, 4 hours ago -
NotifyIcons — Put that System tray to work!
by
Deanna McElveen
3 days, 9 hours ago -
Decisions to be made before moving to Windows 11
by
Susan Bradley
3 hours, 11 minutes ago -
Port of Seattle says ransomware breach impacts 90,000 people
by
Nibbled To Death By Ducks
3 days, 18 hours ago -
Looking for personal finance software with budgeting capabilities
by
cellsee6
3 days, 2 hours ago -
ATT/Yahoo Secure Mail Key
by
Lil88reb
3 days, 2 hours ago -
Devices with apps using sprotect.sys driver might stop responding
by
Alex5723
4 days, 11 hours ago -
Neowin – 20 times computers embarrassed themselves with public BSODs and goofups
by
EP
4 days, 19 hours ago -
Slow Down in Windows 10 performance after March 2025 updates ??
by
arbrich
19 hours, 12 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.