-
WSAbraxus
AskWoody LoungerMy code links the table then take each record and inserts it into other tables based on certain criteria.
I’ve tried formatting the Excel sheet column to text and I’ve tried putting the non-numeric values at the top, but to no avail.
This is the code I use:
DoCmd.TransferSpreadsheet acLink, acSpreadsheetTypeExcel9, “blahblah”, , True, “”It’s right after this piece that I can check the linked table and see that the column has the wrong data type.
Sign me Very Frustrated!
-
WSAbraxus
AskWoody LoungerDo all tabs have data in them, or do you need to check to see if a tab has data? I think probably Automation would be the best choice in trying to sort that out. For one thing you need to figure out how many tabs each workbook has. You will have to use the Excel object model to do both tasks, and the sheet property is exposed to automation.
Thanks for the pointer….it helped me figure it all out!
-
WSAbraxus
AskWoody LoungerDo all tabs have data in them, or do you need to check to see if a tab has data? I think probably Automation would be the best choice in trying to sort that out. For one thing you need to figure out how many tabs each workbook has. You will have to use the Excel object model to do both tasks, and the sheet property is exposed to automation.
I believe all the tabs have data, but I can easily check to see if there is data in the cells.
-
WSAbraxus
AskWoody LoungerOk, I figured out the problem. It only took me, however, a day and a half.
To validate my numbers, I took the results of the query and copy/pasted them to Excel. I would then AutoSum the data to see the totals.
For some odd reason on one set of data in my cross tab, it worked fine, but in the second set, it included the header row, which was the date in YYYYMM format. It wasn’t until I compared the numbers to see what the difference was that I was able to see the pattern. One month was off my $200,810 the next by $200,811, the next by $200,812 and so on.
I could not believe that it was that simple…UGH!!!!!!!
Looks like it’s back to Excel Formulas 101 for me.
-
WSAbraxus
AskWoody LoungerSome of us more often than we’d care to admit.
-
WSAbraxus
AskWoody LoungerCreate two queries. One to calculate the Min Start time by date and the other to calculate the Max End time by date. Link the two queries by date. See attached (qryMinMax shows the final results):
This worked like a charm, thanks!
-
WSAbraxus
AskWoody LoungerApril 8, 2009 at 10:32 am in reply to: VBA SQL, stop append confirmation, syntax for variables #1155601Is there property setting or alternative way to stop the confirmation for an append?
I am parsing through thousands of records, building a string for each group, and inserting the info into a table.
I am running the following “insert into” in VBA:
strinsertsql = “INSERT INTO PubTable (MFBIndex, UFSiteString, SumUFSiteString, ” & _
“NumberUFSiteString ) ” & _
“values (” & strmfbidx & “, ” & “‘” & strpass & “‘” & “, ” & sumid & “, ” & count & “);”
DoCmd.RunSQL strinsertsqlI get a msgbox with each execution and don’t want to hit OK each time. Any better way to do this or just a property I can set. I can’t seem to find one on my own.
DoCmd.SetWarnings False before the insert
DoCmd.SetWarnings True after the insert -
WSAbraxus
AskWoody LoungerI even tried this
Code:Function ExcelCheck2(strFileIn As String) As Boolean On Error Resume Next Set xlApp = GetObject(, "Excel.Application") If xlApp Is Nothing Then MsgBox "Excel is not running", vbInformation Else MsgBox "Excel is running", vbInformation End If Set xlApp = GetObject(strFileIn) If xlApp Is Nothing Then MsgBox "Workbook is not open", vbInformation ExcelCheck2 = False Else MsgBox "Workbook is open", vbInformation ExcelCheck2 = True End If On Error GoTo 0 End Function
but never get a correct response on the workbook being open…
-
WSAbraxus
AskWoody LoungerI modified your code to this
Code:Function ExcelCheck2(strFileIn As String) As Boolean Dim xlApp As Object On Error Resume Next Set xlApp = GetObject(strFileIn) If xlApp Is Nothing Then ExcelCheck2 = False Else ExcelCheck2 = True End If End Function
but it never returns a FALSE….
-
WSAbraxus
AskWoody LoungerThat’s almost exactly what I did, except I did not create a table. Instead I used the WHERE ID NOT IN (SELECT TOP 25….)
Worked like a charm!
Hi There
This is not the most elegant answer but it may get you out of a hole. I have created a dummy database with a table called tblList, in it were 10 records. From this table I created a table using the Make Table query or the following code:
I then created this bit of SQL
where id not in (select id from tblTop3);It did produce the result….not elegant but could be a start of a solution
-
WSAbraxus
AskWoody LoungerI love it when I can solve my own questions….
Sub ImportAllTabs() Dim strPath As String strPath = "C:PathToFiles" Dim objXL As Object Set objXL = CreateObject("Excel.Application") Dim strFileName As String strFileName = Dir(strPath) While strFileName "" Debug.Print strFileName 'Open the spreadsheet and get the tab names... With objXL .Workbooks.Open Filename:=strPath & strFileName Dim arrSheetName() As String ReDim arrSheetName(objXL.Sheets.Count) For x = 1 To objXL.Sheets.Count arrSheetName(x) = objXL.Sheets(x).Name Next End With objXL.Workbooks.Close 'Import the tabs from this spreadsheet For x = 1 To UBound(arrSheetName) Debug.Print vbTab & arrSheetName(x) DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "TableToImportTo", _ strPath & strFileName, True, arrSheetName(x) & "$" Next x 'Next spreadsheet strFileName = Dir Wend objXL.Quit Set objXL = Nothing End Sub
-
WSAbraxus
AskWoody LoungerShe could not.
I did, however, find the problem. I had only added her under Sharing/Permissions. I added her under Properties/Security, and it worked like a charm.
-
WSAbraxus
AskWoody LoungerI tested it by making a share on my PC for the back end. She gets the linked tables, because I can see the .ldb. There is no mention of read only until she saves, and this code fails
rst.addnew
See the picture for her permissions.
-
WSAbraxus
AskWoody LoungerFebruary 3, 2009 at 12:47 am in reply to: Query based on query based on query based on form (2003) #1145506Hans, I tried your suggestion. Now when I try to open the query in VBA, I get the following error:
Run-time error 3061
Too Few Parameters. Expected 0.This is the VBA in question:
Set rstDetails = db.OpenRecordset(“SELECT * FROM [qryReportA-PO_Count] WHERE BU = ‘” & rstBU!BU & “‘”, dbOpenForwardOnly) -
WSAbraxus
AskWoody LoungerWell that was simple enough…
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
-
Key, Key, my kingdom for a Key!
by
RetiredGeek
3 hours, 19 minutes ago -
Registry Patches for Windows 10
by
Drcard:))
7 hours, 50 minutes ago -
Cannot get line length to NOT wrap in Outlining in Word 365
by
CWBillow
8 hours, 2 minutes ago -
DDU (Display Driver Uninstaller) updates
by
Alex5723
1 hour, 12 minutes ago -
Align objects on a OneNote page
by
CWBillow
13 hours, 18 minutes ago -
OneNote Send To button?
by
CWBillow
14 hours, 2 minutes ago -
WU help needed with “Some settings are managed by your organization”
by
Peobody
22 hours, 35 minutes ago -
No Newsletters since 27 January
by
rog7
18 hours, 31 minutes ago -
Linux Mint Debian Edition 7 gets OEM support, death of Ubuntu-based Mint ?
by
Alex5723
1 day, 3 hours ago -
Windows Update “Areca Technology Corporation – System – 6.20.0.41”
by
Bruce
41 minutes ago -
Google One Storage Questions
by
LHiggins
59 minutes ago -
Button Missing for Automatic Apps Updates
by
pmcjr6142
50 minutes ago -
Ancient SSD thinks it’s new
by
WSila
3 hours, 43 minutes ago -
Washington State lab testing provider exposed health data of 1.6 million people
by
Nibbled To Death By Ducks
1 day, 13 hours ago -
WinRE KB5057589 fake out
by
Susan Bradley
1 day, 6 hours ago -
The April 2025 Windows RE update might show as unsuccessful in Windows Update
by
Susan Bradley
21 hours, 21 minutes ago -
Firefox 137
by
Charlie
7 minutes ago -
Whisky, a popular Wine frontend for Mac gamers, is no more
by
Alex5723
2 days, 1 hour ago -
Windows 11 Insider Preview build 26120.3863 (24H2) released to BETA
by
joep517
2 days, 1 hour ago -
Windows 11 Insider Preview build 26200.5551 released to DEV
by
joep517
2 days, 2 hours ago -
New Windows 11 PC setup — can I start over in the middle to set up a local id?
by
ctRanger
21 hours, 50 minutes ago -
Windows 11 Insider Preview Build 26100.3902 (24H2) released to Release Preview
by
joep517
2 days, 5 hours ago -
Oracle kinda-sorta tells customers it was pwned
by
Nibbled To Death By Ducks
2 days, 11 hours ago -
Global data centers (AI) are driving a big increase in electricity demand
by
Kathy Stevens
2 days, 21 hours ago -
Office apps read-only for family members
by
b
3 days ago -
Defunct domain for Microsoft account
by
CWBillow
2 days, 21 hours ago -
24H2??
by
CWBillow
21 hours, 43 minutes ago -
W11 23H2 April Updates threw ‘class not registered’
by
WindowsPersister
17 hours, 37 minutes ago -
Master patch listing for April 8th, 2025
by
Susan Bradley
21 hours, 34 minutes ago -
TotalAV safety warning popup
by
Theodore Nicholson
1 day, 20 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.