-
WSdazednconfused
AskWoody LoungerSeptember 9, 2004 at 11:21 am in reply to: SQL not populateing recordset in code (Access 2000) #875135Hope a zip file is OK?
-
WSdazednconfused
AskWoody LoungerSeptember 9, 2004 at 11:09 am in reply to: SQL not populateing recordset in code (Access 2000) #875130Thanks for the replies.
OK, i’ve taken out the spaces.
I then did the immediate window bit, thanks that’s going to be a useful tip
Pasted the code into the Query SQL window, nothing is returned (I was expecting this but at least I now KNOW). I then had a quick ‘play’ with the Query in Design view and it returned the correct results. On viewing it in SQL it now looks like this: –
SELECT *
FROM PrimaryDataTbl
WHERE (((PrimaryDataTbl.DateReceived) Between #1/1/2000# And #9/1/2004#) AND ((PrimaryDataTbl.VendorNumber)=17999));However, if I try that in my VBA it doesn’t like it at all, not that I really expected it to, but desperation drives you to wierd things….
I then tried defining my fields in the query (PrimaryDataTbl.FieldName) to see if that helped, still no luck.
So, is there something in my SQL statement that is causing the problem? I could create a Query and use QueryDefs, but that seems to be overkill for something this simple.
I’ll look into stripping the database out to get it to < 100k.
Thanks again.
Ian
-
WSdazednconfused
AskWoody LoungerSeptember 9, 2004 at 11:09 am in reply to: SQL not populateing recordset in code (Access 2000) #875131Thanks for the replies.
OK, i’ve taken out the spaces.
I then did the immediate window bit, thanks that’s going to be a useful tip
Pasted the code into the Query SQL window, nothing is returned (I was expecting this but at least I now KNOW). I then had a quick ‘play’ with the Query in Design view and it returned the correct results. On viewing it in SQL it now looks like this: –
SELECT *
FROM PrimaryDataTbl
WHERE (((PrimaryDataTbl.DateReceived) Between #1/1/2000# And #9/1/2004#) AND ((PrimaryDataTbl.VendorNumber)=17999));However, if I try that in my VBA it doesn’t like it at all, not that I really expected it to, but desperation drives you to wierd things….
I then tried defining my fields in the query (PrimaryDataTbl.FieldName) to see if that helped, still no luck.
So, is there something in my SQL statement that is causing the problem? I could create a Query and use QueryDefs, but that seems to be overkill for something this simple.
I’ll look into stripping the database out to get it to < 100k.
Thanks again.
Ian
-
WSdazednconfused
AskWoody LoungerFrancois
As yet I don’t what’s different between your SQL string and mine, but whatever it is it works
another learning opportunity provided by the good folks of Woody’s lounge
Thanks
Ian
-
WSdazednconfused
AskWoody LoungerFrancois
As yet I don’t what’s different between your SQL string and mine, but whatever it is it works
another learning opportunity provided by the good folks of Woody’s lounge
Thanks
Ian
-
WSdazednconfused
AskWoody LoungerSeptember 2, 2004 at 2:56 pm in reply to: Adding record to a temprorary recordset in code (Access 2k) #872119Arrays look like they might be my answer, now how would I refer to the data in the array? With a recordset I can use RST!ItemName and loop through it using the MoveNext instruction. Looking at the Using Arrays help section there are not hints on how to do the same, getting data in appears to be easy enough even for me to manage
I’ll keep reading, but if there’s any easy way, send it my way please
Thanks
Ian
-
WSdazednconfused
AskWoody LoungerSeptember 2, 2004 at 2:56 pm in reply to: Adding record to a temprorary recordset in code (Access 2k) #872120Arrays look like they might be my answer, now how would I refer to the data in the array? With a recordset I can use RST!ItemName and loop through it using the MoveNext instruction. Looking at the Using Arrays help section there are not hints on how to do the same, getting data in appears to be easy enough even for me to manage
I’ll keep reading, but if there’s any easy way, send it my way please
Thanks
Ian
-
WSdazednconfused
AskWoody LoungerSeptember 2, 2004 at 1:37 pm in reply to: Adding record to a temprorary recordset in code (Access 2k) #872067Well, the demo looks nice, however, it’s taken me a while to gain any level of confidence in DAO, so moving to ADO is not something I’m in a hurry to do…
I don’t want to keep the data any longer than the code is running for, if I can’t do this purely in VBA, can I create a new table, populate it with the file name, then delete it after I’ve used the data? Or is this going to be more difficult than learning the dark arts of ADO???
Thanks
Ian
-
WSdazednconfused
AskWoody LoungerSeptember 2, 2004 at 1:37 pm in reply to: Adding record to a temprorary recordset in code (Access 2k) #872068Well, the demo looks nice, however, it’s taken me a while to gain any level of confidence in DAO, so moving to ADO is not something I’m in a hurry to do…
I don’t want to keep the data any longer than the code is running for, if I can’t do this purely in VBA, can I create a new table, populate it with the file name, then delete it after I’ve used the data? Or is this going to be more difficult than learning the dark arts of ADO???
Thanks
Ian
-
WSdazednconfused
AskWoody LoungerI just tried this simple code in the on gotfocus event, you can use it in other ways.
Dim strVar As String
Dim strOutput As StringstrVar = 0
If Me.Text0 0 Then
strVar = strVar + 1
End If
If Me.Text2 0 Then
strVar = strVar + 1
End If
If Me.Text4 0 Then
strVar = strVar + 1
End If
If Me.Text6 0 Then
strVar = strVar + 1
End IfstrOutput = (Me.Text0.Value + Me.Text2.Value + Me.Text4.Value + Me.Text6.Value) / strVar
Me.Text8 = strOutput
The text boxes just hold values, text8 give the average when it gets the focus.
-
WSdazednconfused
AskWoody LoungerI just tried this simple code in the on gotfocus event, you can use it in other ways.
Dim strVar As String
Dim strOutput As StringstrVar = 0
If Me.Text0 0 Then
strVar = strVar + 1
End If
If Me.Text2 0 Then
strVar = strVar + 1
End If
If Me.Text4 0 Then
strVar = strVar + 1
End If
If Me.Text6 0 Then
strVar = strVar + 1
End IfstrOutput = (Me.Text0.Value + Me.Text2.Value + Me.Text4.Value + Me.Text6.Value) / strVar
Me.Text8 = strOutput
The text boxes just hold values, text8 give the average when it gets the focus.
-
WSdazednconfused
AskWoody LoungerHans
Thanks, this worked, any idea why it worked?
Ian
-
WSdazednconfused
AskWoody LoungerHans
Thanks, this worked, any idea why it worked?
Ian
-
WSdazednconfused
AskWoody LoungerHi
You can export data to Excel, from Access, in a number of ways, transferspreadsheet, DoCmd.OutputTo, or automation. Which way you do depends on exactly how you want to manipulate the data as it leaves Access.
Also, why use Excel and Access? Why not just allow the user to select specific data for viewing through the Access database?
Ian
-
WSdazednconfused
AskWoody LoungerHi
You can export data to Excel, from Access, in a number of ways, transferspreadsheet, DoCmd.OutputTo, or automation. Which way you do depends on exactly how you want to manipulate the data as it leaves Access.
Also, why use Excel and Access? Why not just allow the user to select specific data for viewing through the Access database?
Ian
![]() |
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
-
T-Mobile 5G Wireless Internet
by
WSmmi16
45 minutes ago -
Clock missing above calendar in Windows 10
by
WSCape Sand
31 minutes ago -
Formula to Calculate Q1, Q2, Q3, or Q4 of the Year?
by
WSJon5
5 hours, 19 minutes ago -
The time has come for AI-generated art
by
Catherine Barrett
11 hours, 46 minutes ago -
Hackers are using two-factor authentication to infect you
by
B. Livingston
5 hours, 48 minutes ago -
23 and you
by
Max Stul Oppenheimer
11 hours, 48 minutes ago -
April’s deluge of patches
by
Susan Bradley
58 minutes ago -
Windows 11 Windows Updater question
by
Tex265
4 hours, 2 minutes ago -
Key, Key, my kingdom for a Key!
by
RetiredGeek
1 day, 2 hours ago -
Registry Patches for Windows 10
by
Drcard:))
1 day, 7 hours ago -
Cannot get line length to NOT wrap in Outlining in Word 365
by
CWBillow
14 hours ago -
DDU (Display Driver Uninstaller) updates
by
Alex5723
1 day ago -
Align objects on a OneNote page
by
CWBillow
1 day, 12 hours ago -
OneNote Send To button?
by
CWBillow
1 day, 13 hours ago -
WU help needed with “Some settings are managed by your organization”
by
Peobody
1 day, 22 hours ago -
No Newsletters since 27 January
by
rog7
2 hours, 46 minutes ago -
Linux Mint Debian Edition 7 gets OEM support, death of Ubuntu-based Mint ?
by
Alex5723
22 hours, 43 minutes ago -
Windows Update “Areca Technology Corporation – System – 6.20.0.41”
by
Bruce
21 hours, 23 minutes ago -
Google One Storage Questions
by
LHiggins
5 hours, 22 minutes ago -
Button Missing for Automatic Apps Updates
by
pmcjr6142
12 hours, 37 minutes ago -
Ancient SSD thinks it’s new
by
WSila
1 day, 3 hours ago -
Washington State lab testing provider exposed health data of 1.6 million people
by
Nibbled To Death By Ducks
2 days, 12 hours ago -
WinRE KB5057589 fake out
by
Susan Bradley
1 hour, 41 minutes ago -
The April 2025 Windows RE update might show as unsuccessful in Windows Update
by
Susan Bradley
1 day, 20 hours ago -
Firefox 137
by
Charlie
23 hours, 43 minutes ago -
Whisky, a popular Wine frontend for Mac gamers, is no more
by
Alex5723
3 days, 1 hour ago -
Windows 11 Insider Preview build 26120.3863 (24H2) released to BETA
by
joep517
3 days, 1 hour ago -
Windows 11 Insider Preview build 26200.5551 released to DEV
by
joep517
3 days, 1 hour ago -
New Windows 11 PC setup — can I start over in the middle to set up a local id?
by
ctRanger
1 day, 21 hours ago -
Windows 11 Insider Preview Build 26100.3902 (24H2) released to Release Preview
by
joep517
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.