-
WSAccessMan
AskWoody Loungerwhat i have been doing is calling the function at the notinlist event (which triggered because the entry wasn’t in the list).. then it changes the value of the text in the combobox with the function. When it changes the text, this new text also is not in the list, so it triggers the notinlist event in the middle of the current event. It does do all this before the record is saved, but like i said, it triggers the event more than once.
Here is the code in my form…
Option Compare Database
Option ExplicitDim SearchValue, ReplaceValue, SearchStr, Source, CustomerString As String
Private Sub cmbCustomer_NotInList(NewData As String, Response As Integer)
Dim Db As DAO.Database
Dim Rs As DAO.Recordset
Dim Msg As StringCustomerString = cmbCustomer.Text
On Error GoTo Err_cmbCustomer_NotInList
SearchStr = CustomerString
Source = “cmbCustomer”Call CheckForAbbreviations
‘ Exit this subroutine if the combo box was cleared.
If NewData = “” Then Exit Sub‘ Confirm that the user wants to add the new customer.
Msg = “The Customer ‘” & NewData & “‘ is not in the list.” & vbCr & vbCr
Msg = Msg & “Do you want to add this Customer? @@Please make sure punctuation and spelling are correct!!”
If MsgBox(Msg, vbQuestion + vbYesNo) = vbNo Then
‘ If the user chose not to add a customer, set the Response
‘ argument to suppress an error message and undo changes.
Response = acDataErrContinue
‘ Display a customized message.
MsgBox “Please select a Customer from the list”
Else
‘ If the user chose to add a new customer, open a recordset
‘ using the Customers table.
Set Db = CurrentDb
Set Rs = Db.OpenRecordset(“tblCustomers”, dbOpenDynaset)Rs.AddNew
Rs.Update‘ Set Response argument to indicate that new data is being added.
Response = acDataErrAddedEnd If
Exit_cmbCustomer_NotInList:
Exit Sub
Err_cmbCustomer_NotInList:
‘ An unexpected error occurred, display the normal error message.
MsgBox Err.Description
‘ Set the Response argument to suppress an error message and undo
‘ changes.
Response = acDataErrContinueEnd Sub
Private Sub CheckForAbbreviations()
SearchValue = “company”
ReplaceValue = “Co.”Call ChangeAbbreviations
SearchValue = “corporation”
ReplaceValue = “Corp.”Call ChangeAbbreviations
SearchValue = ” and ”
ReplaceValue = ” & ”Call ChangeAbbreviations
End Sub
Private Sub ChangeAbbreviations()
Dim searchstart, searchend As IntegerSearchStr = CustomerString
searchstart = InStr(1, SearchStr, SearchValue)
If searchstart 0 Then
searchend = searchstart + Len(SearchValue)cmbCustomer.text = Left(SearchStr, (searchstart – 1)) & ReplaceValue & Right(SearchStr, (Len(SearchStr) – (searchend – 1)))
End If
End Sub
-
WSAccessMan
AskWoody LoungerJanuary 3, 2003 at 4:16 pm in reply to: Set Taskbar Autohide / Always-On-Top with code (Access 97) #642146Hmm….
The reason i didn’t was because in the past, the auto-center property was not working correctly… However, since you said that, i tried it out. I found out that the auto-center does not work when you go from design view to form view (which was how i was testing the forms out). I just now tried it by opening the form from the database menu, and wouldn’t you know it.. It worked! I guess that goes to show you that if something does not work how you would expect it to, take the time to find out why… Thanks for pointing that out Hans.. i kind of feel like an idiot now!!
-
WSAccessMan
AskWoody LoungerJanuary 3, 2003 at 4:03 pm in reply to: Set Taskbar Autohide / Always-On-Top with code (Access 97) #642140Mark and Charlotte:
I think i figured out an acceptable workaround… (and if this is something either of you hinted at but i didn’t catch, i apologize). The reason i wanted to change screen resolution was so my forms were centered and look good on the screen. I accomplished this by figuring the width and height of the screen (5900×3900 twips @ 800×600). Then i set the calculated center of the form to the calculated center of the screen…
What i have now decided to do was to simply check the computer’s resolution, then change the calculated center depending on that screen resolution. It seems like a simple solution to the problem, but this is really all i was looking for in the first place
.
Thank you both for your help!!
-
WSAccessMan
AskWoody LoungerJanuary 3, 2003 at 11:44 am in reply to: Set Taskbar Autohide / Always-On-Top with code (Access 97) #642047Thanks Mark
I appreciate your continued help -
WSAccessMan
AskWoody LoungerJanuary 2, 2003 at 2:44 pm in reply to: Set Taskbar Autohide / Always-On-Top with code (Access 97) #641790Thanks Charlotte…
So i guess you are saying to design it for 800×600 and let the forms and such for 1024×768 resolution be off center? I had toyed with that and really that is how it is set up, but things just look alot better if everyone is at the same resolution.
Let me know if you meant something different. Thanks! -
WSAccessMan
AskWoody LoungerJanuary 2, 2003 at 12:58 pm in reply to: Set Taskbar Autohide / Always-On-Top with code (Access 97) #641767Thanks Mark,
I like the idea of resizing the app to cover the whole screen… however your attachment only resizes a form (unfortunately this will not work with the scheme of things i have set up.) The first link you gave me looks intriguing, however i cannot get the code to work. If there would be any way you could check the code out, that would be fantastic. I am not too adept at code dealing with api functions and such…I also agree with you and charlotte about not changing settings, but i am unsure of any other way to go around the problem… If either of you two have any other ideas, i am absolutely open to suggestions
)
thanks a bunch
-
WSAccessMan
AskWoody LoungerDecember 31, 2002 at 5:57 pm in reply to: Set Taskbar Autohide / Always-On-Top with code (Access 97) #641533Thanks for your reply
I had checked that article out previously, and it did hide and show the taskbar, however it does not actually set the “auto-hide” or “always-on-top” property. I will admit, as i explained my problem earlier, it would seem that this article would solve it.I will attempt to explain the problem further… I am using a procedure that changes the resolution to 800×600. This is all fine and dandy except that after the resolution changes, the taskbar dissappears and the access window does not go all the way down to the bottom of the screen (it goes to the top of where the taskbar was). The only way that i have found to workaround the problem that is acceptable to me is when the “auto-hide” is set on or “always-on-top” is off. That way the access window extends all the way to the bottom of the screen. (the taskbar is still missing, but i am willing to sacrafice that). I want to be able to change either of those settings to be able to see the full screen, then change the setting back when the application closes.
Hopefully this clarified my problem. If you have any different suggestions, please let me know.
Thanks in advance
-
WSAccessMan
AskWoody Loungerwell, much of the data in some fields is only several words or so. however sometimes there are many words in the field, and i would like the users to be able to read all of what is in that field. perhaps i don’t need to be able to resize the field, but can the user get to all the data in a field that is not long enough? (perhaps selecting the field and pressing the “End” key)
thanks for your input
-
WSAccessMan
AskWoody Loungerthanks guys, that seemed to fix the problem. i guess i misunderstood our IT guy – i thought everyone had the same rights. It turned out that the two secretaries had “Modify” rights, but not “Create” rights. things are working now.
i just wonder if there is a way to give all users all the rights, except prevent them from seeing the files in windows explorer? That way Access can do whatever it needs, but i don’t have to worry about them going in and deleting the database or something… is this even a possiblity?
thanks for your help
-
WSAccessMan
AskWoody LoungerSmoke Eater:
I have had this problem in the past, though it had to do with employee names (sometimes they change their names, etc.)
You can use this code by creating two forms: one that is hidden and uses the table in which you want to update as its
recordsource. (i used frmUpdate in the example for this) The other is where you select the name you want to change
and type in the new name. (i used frmChangeName in the example for this). on frmUpdate, the only field you need
is the one you are updating (i used CustomerName in this example).this may not be the best or most efficient way to do this, but it has worked for me. you can also search the customer table and simply change the customer from one to the other instead of creating a new customer.
Insert this code into an event on the frmChangeName form after you have selected the old name and provided the new name:
DoCmd.OpenForm “frmUpdate”, acNormal, , , , acHidden
Insert this code into the frmUpdate form.
Private Sub Form_Load()
Dim totalrecords As IntegerDoCmd.GoToRecord , , acLast
totalrecords = Me.CurrentRecord
DoCmd.GoToRecord , , acFirst ‘this bit of code finds out how many records need to be searchedIf totalrecords > 0 Then
While Me.CurrentRecord <= totalrecords
Call changenames
If Me.CurrentRecord < totalrecords Then
DoCmd.GoToRecord , , acNext
Else
DoCmd.Close acForm, "frmUpdate", acSaveYes
Exit Sub
End If
Wend
End IfDoCmd.Close acForm, "frmUpdate", acSaveYes
End Sub
Private Sub changenames()
'this will check all records in the table you are searching. if the CustomerName
'matches the name you want to change, then it will change it to the new name. If
'it does not match, it will simply skip that record and move to the next oneDim sourceform As String, sourcecontrol As String, ctl As Control
Dim sourcecontrol2 As String, ctl2 As Control
sourceform = "frmChangeName"
sourcecontrol = "txtOldName" 'the field with the name you want to change
sourcecontrol2 = "txtNewName" 'the field with the name you want to change the old one toSet ctl = Forms(sourceform)(sourcecontrol)
Set ctl2 = Forms(sourceform)(sourcecontrol2)If CustomerName = ctl.Value Then CustomerName = ctl2.Value
End Sub
Let me know if you have any problems with this. HTH
-
WSAccessMan
AskWoody Loungerthanks guys,
i changed the startup to shared… i will post back if i have any more problems. -
WSAccessMan
AskWoody Loungerlooks like that will work. Thank you everyone for all your help!
Thanks again
-
WSAccessMan
AskWoody Loungercharlotte,
thanks for taking the time to do that… i just now checked it out and things were ok. however, the print options you supplied automatically print the document. we need to be able to change settings like quantity, etc. the “Print” option in the normal “File” menu does what we want, but the “Print” button in the other toolbars automatically prints. I tried adding the desired print option (actually i added the default “file” menu to your toolbar) and the option was available. if you could do me a favor and take a look at the db i am attaching. try adding a new menu (with the non-auto print option) and see if it gives you any problems. your help would be appreciated.thanks
-
WSAccessMan
AskWoody Loungerhi charlotte
i think i imported it from a different db i worked on… however, i just tried to create a new one and it did not help. i am going to try with the northwind database, but i am out of time at the moment. i will let you know what i find outthanks for your continuing help
-
WSAccessMan
AskWoody Loungeri have the stripped down file, but it is too big to attach. If anyone would like to have a try at it, let me know and i will email it to you.
Thanks
![]() |
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
-
When is MS shutting off Windows 10 spyware servers? (Awaiting moderation)
by
Bill
6 minutes ago -
Windows 11 Insider Preview build 27871 released to Canary
by
joep517
19 hours, 35 minutes ago -
Windows 11 ad from Campaign Manager in Windows 10
by
Jim McKenna
16 hours, 56 minutes ago -
Small desktops
by
Susan Bradley
4 minutes ago -
Totally disable Bitlocker
by
CWBillow
17 hours, 57 minutes ago -
Phishers extract Millions from HMRC accounts..
by
Microfix
17 hours, 12 minutes ago -
Windows 10 22H2 Update today (5 June) says up-to-date but last was 2025-04
by
Alan_uk
1 day, 23 hours ago -
Thoughts on Malwarebytes Scam Guard for Mobile?
by
opti1
25 minutes ago -
Mystical Desktop
by
CWBillow
2 days, 2 hours ago -
Meta and Yandex secretly tracked billions of Android users
by
Alex5723
1 day, 8 hours ago -
MS-DEFCON 2: Do you need that update?
by
Susan Bradley
6 minutes ago -
CD/DVD drive is no longer recognized
by
WSCape Sand
2 days, 18 hours ago -
Windows 11 24H2 Default Apps stuck on Edge and Adobe Photoshop
by
MikeBravo
2 days, 20 hours ago -
North Face and Cartier customer data stolen in cyber attacks
by
Alex5723
2 days, 18 hours ago -
What is wrong with simple approach?
by
WSSpoke36
17 hours, 3 minutes ago -
Microsoft-Backed Builder.ai Set for Bankruptcy After Cash Seized
by
Alex5723
3 days, 6 hours ago -
Location, location, location
by
Susan Bradley
1 day, 20 hours ago -
Cannot get a task to run a restore point
by
CWBillow
3 days, 7 hours ago -
Frustrating search behavior with Outlook
by
MrJimPhelps
2 days, 22 hours ago -
June 2025 Office non-Security Updates
by
PKCano
3 days, 18 hours ago -
Secure Boot Update Fails after KB5058405 Installed
by
SteveIT
1 day, 21 hours ago -
Firefox Red Panda Fun Stuff
by
Lars220
3 days, 18 hours ago -
How start headers and page numbers on page 3?
by
Davidhs
4 days, 4 hours ago -
Attack on LexisNexis Risk Solutions exposes data on 300k +
by
Nibbled To Death By Ducks
3 days, 7 hours ago -
Windows 11 Insider Preview build 26200.5622 released to DEV
by
joep517
4 days, 13 hours ago -
Windows 11 Insider Preview build 26120.4230 (24H2) released to BETA
by
joep517
4 days, 13 hours ago -
MS Excel 2019 Now Prompts to Back Up With OneDrive
by
lmacri
4 days, 3 hours ago -
Firefox 139
by
Charlie
3 days, 19 hours ago -
Who knows what?
by
Will Fastie
2 days, 22 hours ago -
My top ten underappreciated features in Office
by
Peter Deegan
1 day 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.