-
WSMarkD
AskWoody LoungerI tested this using an autonumber (primary key) and numeric field as 1st two columns of combo and it worked fine, using same generic code created by wizard. Did not have to convert any numeric values to text. The first column of combo (Autonumber) is set to 0″. Not sure what is causing your problem, but would recommend modifying code created by wizard to something like:
Private Sub Combo8_AfterUpdate() ' Find the record that matches the control. Dim rs As DAO.Recordset Set rs = Me.Recordset.Clone rs.FindFirst "[ID] = " & Me![Combo8] Me.Bookmark = rs.Bookmark rs.Close Set rs = Nothing End Sub
Using “Dim rs as Object” is real slow, even on a small test table. And was not necessary to convert combo value with STR function. This is obvious, but are you sure the form’s recordsource includes the MemberID field?
-
WSMarkD
AskWoody LoungerI checked out the attachment, if you changed the Enabled/Locked properties from Yes/No to No/Yes the highlighting went away… but if you want to change the Keyboard “Behavior Entering Field” options when opening/closing form use the applicable Application SetOption method on the form’s On Open or On Close event:
Application.SetOption "Behavior Entering Field", 0 'Select entire field Application.SetOption "Behavior Entering Field", 1 'Go to start of field Application.SetOption "Behavior Entering Field", 2 'Go to end of field
HTH
-
WSMarkD
AskWoody LoungerIf text will not be updated then change the text box Tab Stop property to No and text will not be highlighted when you open form.
-
WSMarkD
AskWoody LoungerAccording to a Microsoft Knowledge Base article, the error message you are getting may be due to a corrupted memo or OLE field. You may want to check out this article: ACC: Jet Database Engine 3.x Error Messages Due to Corruption (Q182867)
HTH -
WSMarkD
AskWoody LoungerIn what version of FoxPro are these tables? If they are old FoxPro 2.X tables you should be able to use the Free Table Directory option under “Database type” when setting up the ODBC Data Source using the Visual FoxPro driver. If the tables are created in Visual FoxPro 3.0 or later, then Free Table Directory doesn’t work, you have to select the “Visual FoxPro database (.DBC)” option when setting up the data source. You would then browse for the path of the *.DBC file, which acts as a container for the Visual FoxPro tables (*.DBF files) (they would be in same folder). If set up correctly you should then be able to either link or import the Visual FoxPro tables.
-
WSMarkD
AskWoody LoungerIf using StrConv function in a query expression, use the vbProperCase constant’s numerical value rather than named constant, e.g.:
StrConv([FLD_NAME],3)
The Object Browser will provide the numerical equivalent for named constants, e.g. Const vbProperCase = 3.
HTH -
WSMarkD
AskWoody LoungerYou could use something like this:
Private Sub Report_Open(Cancel As Integer) Me.Filter = "[CustomerID] In (1,7,17,52,53)" Me.FilterOn = True End Sub
This assumes the CustomerID number is an actual number and not text. If CustomerID is text data type then the filter values should be delimited by single quotes:
"[CustomerID] In ('1','7','17','52','53')"
In either case the “Me.Filter” should precede the “Me.FilterOn” statement. If the values you are filtering on can change in number or value, recommend using an array variable to populate the “IN” statement.
HTH -
WSMarkD
AskWoody LoungerNot sure what you want to look for, but you can search each query’s SQL for a specified string using something like this:
Sub SearchQuerySQL(strFindMe As String) Dim db As DAO.Database Dim qry As DAO.QueryDef Set db = CurrentDb For Each qry In db.QueryDefs If InStr(qry.SQL, strFindMe) > 0 Then Debug.Print "QUERY: " & qry.Name & vbCrLf & "SQL: " & qry.SQL End If Next qry Set db = Nothing Set qry = Nothing End Sub
This will print both name of query and its SQL string where match is found. If you only need to identify the query, modify the Debug.Print statement accordingly.
-
WSMarkD
AskWoody LoungerJanuary 31, 2002 at 11:13 am in reply to: Filter on Memo Field Contains Searchstring (Access 97(SR-1)) #567372If you use a parameter query the SQL would look like this:
SELECT TBLNAME.COMMENTS FROM TBLNAME WHERE (((TBLNAME.COMMENTS) Like "*" & [ENTER SEARCH STRING:] & "*"));
HTH
-
WSMarkD
AskWoody LoungerIf you are trying to sort report by time only (disregarding date information) you might try using the TimeValue function in your report or underlying query to convert Date/Time field value to a time-only value. For example, if you have a Date/Time field named “DATE_UPDTD”, use this expression in a query:
TIME_UPDTD: TimeValue([DATE_UPDTD])
Then sort on the TIME_UPDTD column to sort records from earliest time to latest, ignoring the date values. Note in this example if the date/time field is null, the expression will generate an error, so you would have to either filter out the null date/time records if there are any, or modify the expression.
-
WSMarkD
AskWoody LoungerNo, you’re stuck with default grey. Your only option would be to set tab control’s Back Style property to Transparent and then the section back color would be displayed beneath any controls placed on the tab control. The tabs themselves (or buttons) would still be generic grey, however. Other option is to add a rectangle on a tab control page, set back style to normal and set back color to desired color. You may have to use Format > Send to Back command to make sure the rectangle doesn’t obscure any controls inside its borders. Combined with first option you may achieve desired effect.
-
WSMarkD
AskWoody LoungerJanuary 22, 2002 at 4:44 pm in reply to: Adding Rectangle around Bound Controls? (A2k (9.0.4402) SR-1) #565325Select the rectangle then use Format menu > Send to Back command to send rectangle “behind” the controls. Or make rectangle transparent then select the controls and use Format > Bring to Front command.
-
WSMarkD
AskWoody LoungerAnother option is use Insert Object > Create from File command to insert the .MP3 file on a worksheet as an object. Use something like this to playback the sound:
Sub PlayAudio() Application.DisplayAlerts = False Worksheets(1).Shapes("Object 1").Select Selection.Verb Application.DisplayAlerts = True End Sub
You can call this sub from the Workbook_Open event to have music play upon opening workbook. As recommended by Andrew C. make sure your MP3 player is active but minimized or else it will pop up on top of your workbook (I tested this with MusicMatch Jukebox player). One possible drawback if the MP3 file is linked, when you open the workbook you get the dreaded “The workbook you opened contains automatic links to another workbook…” alert. If the MP3 file is embedded you won’t have this problem, but for a 5 minute MP3 you will have a very large .XLS file.
HTH. -
WSMarkD
AskWoody LoungerWSC:
I was unable to reproduce loop error on my system. I’m running A2K SR-1A on WIN 98 SE. I did find one bug, though, in the database I was testing this with I have form that allows user to open more than one instance of same form. There are other forms that requery certain controls on the first form on their On_Close event. If I had several instances of first form open and one or more of these other forms open, it sometimes resulted in runtime error 2450, depending on sequence in which the forms were opened (IsLoaded equated to true, but name of form not found in Forms collection). I added error handling for this. If you are not opening multiple instances of same form this should not be an issue.
-
WSMarkD
AskWoody LoungerYou can use the following code to close all open forms in your application:
Public Sub CloseOpenForms() Dim frm As Form Dim n As Integer n = Application.Forms.Count Do While n > 0 For Each frm In Application.Forms If IsLoaded(frm.NAME) Then DoCmd.Close acForm, frm.NAME End If Next frm n = Application.Forms.Count Loop Set frm = Nothing End Sub
You need the Do Loop to refresh open forms count or else not all forms will be closed. The above uses the IsLoaded function found in Northwind.mdb:
Function IsLoaded(ByVal strFormName As String) As Boolean ' Returns True if the specified form is open in Form view or Datasheet view. Const conObjStateClosed = 0 Const conDesignView = 0 If SysCmd(acSysCmdGetObjectState, acForm, strFormName) conObjStateClosed Then If Forms(strFormName).CurrentView conDesignView Then IsLoaded = True End If End If End Function
These two procedures should be added to a standard module. To close all forms (including the one you are calling the procedure from) and open a new form, use this code for a event procedure:
CloseOpenForms DoCmd.OpenForm "NameOfNewForm"
Hope this helps.
![]() |
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
-
Meta and Yandex secretly tracked billions of Android users
by
Alex5723
2 hours, 2 minutes ago -
MS-DEFCON 2: Do you need that update?
by
Susan Bradley
3 hours, 11 minutes ago -
What Terminal Is Southwest at Austin Airport? Find Complete AUS Terminal Info (Awaiting moderation)
by
airlinesterminaloffice1
4 hours, 9 minutes ago -
What Terminal Is Southwest at Austin Airport? Find Complete AUS Terminal Info (Awaiting moderation)
by
airlinesterminaloffice1
4 hours, 14 minutes ago -
CD/DVD drive is no longer recognized
by
WSCape Sand
14 hours, 32 minutes ago -
Windows 11 24H2 Default Apps stuck on Edge and Adobe Photoshop
by
MikeBravo
17 hours, 22 minutes ago -
North Face and Cartier customer data stolen in cyber attacks
by
Alex5723
15 hours, 27 minutes ago -
What is wrong with simple approach?
by
WSSpoke36
7 hours, 59 minutes ago -
Microsoft-Backed Builder.ai Set for Bankruptcy After Cash Seized
by
Alex5723
1 day, 2 hours ago -
Location, location, location
by
Susan Bradley
4 hours, 33 minutes ago -
Cannot get a task to run a restore point
by
CWBillow
1 day, 4 hours ago -
Frustrating search behavior with Outlook
by
MrJimPhelps
19 hours, 2 minutes ago -
June 2025 Office non-Security Updates
by
PKCano
1 day, 15 hours ago -
Secure Boot Update Fails after KB5058405 Installed
by
SteveIT
11 hours, 27 minutes ago -
Firefox Red Panda Fun Stuff
by
Lars220
1 day, 14 hours ago -
How start headers and page numbers on page 3?
by
Davidhs
2 days, 1 hour ago -
Attack on LexisNexis Risk Solutions exposes data on 300k +
by
Nibbled To Death By Ducks
1 day, 4 hours ago -
Windows 11 Insider Preview build 26200.5622 released to DEV
by
joep517
2 days, 10 hours ago -
Windows 11 Insider Preview build 26120.4230 (24H2) released to BETA
by
joep517
2 days, 10 hours ago -
MS Excel 2019 Now Prompts to Back Up With OneDrive
by
lmacri
1 day, 23 hours ago -
Firefox 139
by
Charlie
1 day, 16 hours ago -
Who knows what?
by
Will Fastie
18 hours, 45 minutes ago -
My top ten underappreciated features in Office
by
Peter Deegan
2 days, 10 hours ago -
WAU Manager — It’s your computer, you are in charge!
by
Deanna McElveen
4 hours, 24 minutes ago -
Misbehaving devices
by
Susan Bradley
1 day, 6 hours ago -
.NET 8.0 Desktop Runtime (v8.0.16) – Windows x86 Installer
by
WSmeyerbos
3 days, 16 hours ago -
Neowin poll : What do you plan to do on Windows 10 EOS
by
Alex5723
15 hours, 37 minutes ago -
May 31, 2025—KB5062170 (OS Builds 22621.5415 and 22631.5415 Out-of-band
by
Alex5723
3 days, 15 hours ago -
Discover the Best AI Tools for Everything
by
Alex5723
2 days, 14 hours ago -
Edge Seems To Be Gaining Weight
by
bbearren
3 days, 5 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.