-
WSwemeier
AskWoody LoungerIt depends on how your data is organized. If you have invoices (with their invoice numbers) in one table and the items on each invoice in another then you may have to do two finds. If invoice number and item number are in the same table then one find will do:
Dim db As Database
Dim recordset As RecordsetSet db = Currentdb()
Set recordset = db.OpenRecordset(“invoice_item_table”)
recordset.FindFirst “invoicenbr = ” & [Search Invoice Number] & ” And itemnbr = ” & [Search Item Number]
[Search Invoice Number] and [Search Item Number] are, of course, whatever fields are holding the invoice number and item number that you are searching for. -
WSwemeier
AskWoody LoungerI checked the Microsoft Knowledge Base and found that, “for backwards compatibility”, it uses Excel 5.0 when you do “Analyze with Excel”. Also, it implies that there is no fix for this, but gives three “workarounds”. You can refer to Microsoft Knowledge Base article number Q201589 for more information.
Edited by Charlotte to activate link
-
WSwemeier
AskWoody LoungerAs long as you don’t use any features new in Access2000 you can convert an Access2000 database back to an Access97 database at any time. The only thing you CAN’T convert back is an mde (compiled database) file. Any MDB will work just fine, though.
-
WSwemeier
AskWoody LoungerTry adding an event procedure in the OnAfterUpdate event for the form that does the following VB coding:
Me.SALN.Requery
This will rerun the query that is acting as the RowSource for the SALN combo box. -
WSwemeier
AskWoody LoungerI’d be glad to look at your database, however, I only have Access97 available to me right now. Could you please convert your database to Access97 (don’t worry, it makes a new copy of the database and leaves your Access2000 database intact) and send me the Access97 database?
-
WSwemeier
AskWoody LoungerAs a last resort I could do that, but there is SOME information on the page header that I’d like to have printed on each ReportFooter page. I could include the information at the top of the ReportFooter section, but it would only print for the first ReportFooter page.
Thanks for the suggestion.
-
WSwemeier
AskWoody LoungerDo you call the function from the OnClick event for the listbox? Click on the listbox and select Properties. In the Event properties there should be something in the OnClick event to call the function. If not, that’s why your coding is not executing. Also, I don’t know if putting the function call in your OnClick event is the best thing to do. What happens if someone clicks on the same order twice? You’ll update inventory twice!
It would be better to let you select an entry from the listbox, then press a command button whose OnClick event points to your function. After processing your function, you should somehow remove that order from the listbox to prevent selecting it a second time.
-
WSwemeier
AskWoody LoungerLet me see if I understand what you are trying to do:
You have a table (Products) of items (ProductID) that contains the onhand inventory (UnitsInStock) of those items. You also have a listbox (OrdersList) containing a list of orders (OrderID) backed by a table (Order Details) containing the items on that order. If you select an order from OrdersList you want to update Products for those items contained in the order’s [Order Details] by adding the Quantity in [Order Details] to the UnitsInStock in Products.
The SQL statement that your friend gave you is essentially correct. What you need to know is how to limit the query to only the selected order. The MyOrder variable should contain the value of the OrderID that was selected from the listbox.
When using a listbox, you can’t directly refer to the selected value. You have to search through the ListBox’s ItemsSelected collection because a listbox can have more than one row selected. The ItemsSelected collection contains a list of the row numbers that are highlighted in the ListBox.
here’s the coding that I think you need:
Public Function UpdateStock()Dim strSQL As String
Dim varRow As VariantFor Each varRow In Me.OrdersList.ItemsSelected
strSQL = “UPDATE Products RIGHT JOIN [Order Details] ON products.Productid = ” _
& “[Order Details].ProductID SET Products.UnitsInStock = ” _
& “[Quantity]+[UnitsInStock] ” _
& “WHERE [Order Details].OrderID= ” & Me.OrdersList.ItemData(varRow) & “;”
DoCmd.RunSQL strSQL
Next varRow
The good thing about this is you can define your listbox as multi-select and let the user select more than one order at a time if you wish. By the way, the above coding assumes that OrderID is numeric. If it is alpha, then you have to put single quotes before and after the double-quotes:‘” & Me.OrdersList.ItemData(varRow) & “‘;”
Hope this helps.
-
WSwemeier
AskWoody LoungerIf you already have a query that extracts ONE person’s transactions, I assume that you imbedded criteria in a query to do this. You then export the query results to Excel.
If you are kicking this process off with a form, try adding a field (it could be hidden) to the form to hold the current user’s name. Next, change the criteria in the query to use the form field’s contents as the criteria. For example:
Forms!frmEmailTransactions!CurrentUser
Then, if you have a table of the usres, walk through the table and, for each user, put that user’s name in the form field. Do a TransferSpreadsheet using the query as the source table. Imbed the user’s name somewhere in the Excel spreadsheet name. The query will export the transactions for the current user to an Excel spreadsheet. For example:
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel97, qryCurrentUsersTransactions, Me.CurrentUser & “‘s Transactions.xls”, True
In the above example, you export to Excel97 the results of running your query (qryCurrentUsersTransactions) and create a file named “abcd’s Transactions.xls” where abcd is the name of the current user. -
WSwemeier
AskWoody LoungerThe OutputTo action is the same as if you chose the “Analyze with Excel” button on the toolbar. This creates an Excel spreadsheet with formatted columns (including formatted column headings). If you do not want the formatted column headings, try using TransferSpreadsheet instead.
-
WSwemeier
AskWoody LoungerYou may want to try the line drawing commands in VBA. You can use them to draw lines of any width and length and to start them at any position on the printed page (not just in the detail section). I use this to draw vertical lines that extend from the column headings to the bottom of the page, regardless of where the last detail line on the page was printed. Look for help on LineDraw.
-
WSwemeier
AskWoody LoungerYou can use Convert Database under Database Utilities to convert the database back to Access 97. However, you may not be able to share the same database between the two versions of Access at the same time. There is some documentation in the Access help files about this.
-
WSwemeier
AskWoody LoungerThe Nz function converts Null strings to zero-length strings! You may want to eliminate the Nz function and let the Null value (if the field is empty) go to the table field (provided the field is not indexed and allows null values).
-
WSwemeier
AskWoody LoungerIf you really wanted to get into the 21st century, try a wireless network! You can buy a wireless NIC with a PCI adapter for your desktop and a wireless PC card for your laptop. Provided the AT&T@Home is connected to your desktop computer, this not only gives you the ability to transfer data between the desktop and laptop, but gives your laptop Internet access from anywhere in the house! You don’t have to bother with a wireless access point. If your desktop is Windows 98 or above you can use Microsoft’s Internet Sharing. Otherwise, get the free (or low-priced, depending on options) Wingate Server software from Wingate. The total cost will be less than $200. With deals, it could get down to about $150.
-
WSwemeier
AskWoody LoungerIf you are intent on doing this with reports, you can do the following:
1. Create a report with no ReportHeader, PageHeader, GroupHeader, GroupFooter, PageFooter or ReportFooter (i.e. only a Detail section). Map your fields in the detail section so you get multiple rows of data to suit your purposes. Save this report.
2. There is a toolbar button that you can use to run the report to Word or Excel. You can add an entry to this toolbar button to output to Notepad. First, right-click on the Database toolbar and choose Customize from the shortcut menu. Click on the Commands tab and you’ll see all of the available commands that can be added to your menus and toolbars. In the Categories list box, select Tools. Now, locate the Output To Notepad button in the Commands list box and drag it to the desired position on the Database toolbar. Then click Close.
Now, whenever you want to create your ASCII file, simply click on the report name, then click the dropdown to the right of the OutputTo toolbar button and choose Output To Notepad!
![]() |
Patch reliability is unclear, but widespread attacks make patching prudent. Go ahead and patch, but watch out for potential problems. |
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
-
Win 7 MS Essentials suddenly not showing number of items scanned.
by
Oldtimer
54 minutes ago -
France : A law requiring messaging apps to implement a backdoor ..
by
Alex5723
5 hours, 45 minutes ago -
Dev runs Windows 11 ARM on an iPad Air M2
by
Alex5723
6 hours, 34 minutes ago -
MS-DEFCON 3: Cleanup time
by
Susan Bradley
1 hour, 35 minutes ago -
KB5056686 (.NET v8.0.15) Delivered Twice in April 2025
by
lmacri
1 hour, 59 minutes ago -
How to enable Extended Security Maintenance on Ubuntu 20.04 LTS before it dies
by
Alex5723
17 hours, 47 minutes ago -
Windows 11 Insider Preview build 26200.5562 released to DEV
by
joep517
21 hours, 46 minutes ago -
Windows 11 Insider Preview build 26120.3872 (24H2) released to BETA
by
joep517
21 hours, 47 minutes ago -
Unable to eject external hard drives
by
Robertos42
1 hour, 14 minutes ago -
Saying goodbye to not-so-great technology
by
Susan Bradley
5 hours, 39 minutes ago -
Tech I don’t miss, and some I do
by
Will Fastie
2 hours, 51 minutes ago -
Synology limits hard drives
by
Susan Bradley
2 days, 1 hour ago -
Links from Microsoft 365 and from WhatsApp not working
by
rog7
1 day, 4 hours ago -
WhatsApp Security Advisories CVE-2025-30401
by
Alex5723
2 days, 8 hours ago -
Upgrade Sequence
by
doneager
2 days, 1 hour ago -
Chrome extensions with 6 million installs have hidden tracking code
by
Nibbled To Death By Ducks
6 hours, 59 minutes ago -
Uninstall “New Outlook” before installing 2024 Home & Business?
by
Tex265
1 day ago -
The incredible shrinking desktop icons
by
Thumper
3 days, 5 hours ago -
Windows 11 Insider Preview Build 22635.520 (23H2) released to BETA
by
joep517
3 days, 6 hours ago -
Connecting hard drive on USB 3.2 freezes File Explorer & Disk Management
by
WSJMGatehouse
5 hours, 44 minutes ago -
Shellbag Analyser & Cleaner Update
by
Microfix
1 day, 15 hours ago -
CISA warns of increased breach risks following Oracle Cloud leak
by
Nibbled To Death By Ducks
3 days, 15 hours ago -
Outlook 2024 two sent from email addresses
by
Kathy Stevens
2 days, 20 hours ago -
Speeding up 11’s search
by
Susan Bradley
1 day, 4 hours ago -
HP Pavilion Will Not Wake Up After Being Idle for Longer Period
by
WSwalterwood44
1 day, 16 hours ago -
Make a Windows 11 Local Account Passwordless
by
Drcard:))
4 days, 5 hours ago -
Ubuntu 25.04 (Plucky Puffin)
by
Alex5723
4 days, 13 hours ago -
24H2 fixed??
by
CWBillow
3 days, 5 hours ago -
Uninstalr Updates
by
jv16
4 days, 18 hours ago -
Apple zero days for April
by
Susan Bradley
15 hours, 18 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.