-
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
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
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
-
MS Excel 2019 Now Prompts to Back Up With OneDrive
by
lmacri
2 hours, 44 minutes ago -
Firefox 139
by
Charlie
2 hours ago -
Who knows what?
by
Will Fastie
30 minutes ago -
My top ten underappreciated features in Office
by
Peter Deegan
21 minutes ago -
WAU Manager — It’s your computer, you are in charge!
by
Deanna McElveen
12 hours, 37 minutes ago -
Misbehaving devices
by
Susan Bradley
2 hours, 29 minutes ago -
.NET 8.0 Desktop Runtime (v8.0.16) – Windows x86 Installer
by
WSmeyerbos
1 day, 6 hours ago -
Neowin poll : What do you plan to do on Windows 10 EOS
by
Alex5723
1 hour, 38 minutes ago -
May 31, 2025—KB5062170 (OS Builds 22621.5415 and 22631.5415 Out-of-band
by
Alex5723
1 day, 4 hours ago -
Discover the Best AI Tools for Everything
by
Alex5723
4 hours, 3 minutes ago -
Edge Seems To Be Gaining Weight
by
bbearren
19 hours, 8 minutes ago -
Rufus is available from the MSFT Store
by
PL1
1 day, 3 hours ago -
Microsoft : Ending USB-C® Port Confusion
by
Alex5723
2 days, 6 hours ago -
KB5061768 update for Intel vPro processor
by
drmark
5 hours, 50 minutes ago -
Outlook 365 classic has exhausted all shared resources
by
drmark
4 hours, 33 minutes ago -
My Simple Word 2010 Macro Is Not Working
by
mbennett555
2 days, 1 hour ago -
Office gets current release
by
Susan Bradley
2 days, 4 hours ago -
FBI: Still Using One of These Old Routers? It’s Vulnerable to Hackers
by
Alex5723
3 days, 18 hours ago -
Windows AI Local Only no NPU required!
by
RetiredGeek
3 days, 3 hours ago -
Stop the OneDrive defaults
by
CWBillow
3 days, 19 hours ago -
Windows 11 Insider Preview build 27868 released to Canary
by
joep517
4 days, 5 hours ago -
X Suspends Encrypted DMs
by
Alex5723
4 days, 7 hours ago -
WSJ : My Robot and Me AI generated movie
by
Alex5723
4 days, 7 hours ago -
Botnet hacks 9,000+ ASUS routers to add persistent SSH backdoor
by
Alex5723
4 days, 8 hours ago -
OpenAI model sabotages shutdown code
by
Cybertooth
4 days, 8 hours ago -
Backup and access old e-mails after company e-mail address is terminated
by
M W Leijendekker
3 days, 21 hours ago -
Enabling Secureboot
by
ITguy
4 days, 4 hours ago -
Windows hosting exposes additional bugs
by
Susan Bradley
4 days, 16 hours ago -
No more rounded corners??
by
CWBillow
4 days, 12 hours ago -
Android 15 and IPV6
by
Win7and10
4 days, 2 hours ago
Recent blog posts
Key Links
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
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.