Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Run time error no value given
Jon Capps 
       
4 years ago
sqlstring = "SELECT * FROM WeekPayForInspector WHERE WkNumInsp = " & Nz(WeeKInput, 0)

MsgBox sqlstring

rs.Open sqlstring, CurrentProject.Connection, adOpenKeyset, adLockReadOnly
Jon Capps OP  @Reply  
       
4 years ago

Jon Capps OP  @Reply  
       
4 years ago
What am I missing, I am stuck!
Adam Schwanz  @Reply  
           
4 years ago
Have you declared rs as recordset?

Is WeekInput a number or short text field?
Jon Capps OP  @Reply  
       
4 years ago
yes sir on Dim rs As ADODB.Recordset
weekinput in the table is a number
Jon Capps OP  @Reply  
       
4 years ago

Jon Capps OP  @Reply  
       
4 years ago
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
Adam Schwanz  @Reply  
           
4 years ago
Hmm and WkNumInsp is spelled correctly... That error usually comes up when it doesn't recognize something and wants a parameter. Is WeekPayForInspector a table or a query?
Jon Capps OP  @Reply  
       
4 years ago
WeekPayForInspector data is from a query
Adam Schwanz  @Reply  
           
4 years ago
OK now we have something that could make sense to want information. Can you upload an image of the query design view?
Alex Hedley  @Reply  
           
4 years ago
What are the values of the other inputs?
CurrentProject.Connection
Scott Axton  @Reply  
      
4 years ago
Based on your first image, it appears to me that your sqlstring is returning WkNumInsp as a string rather than a number.  WeeKInput = "25"

Can you post a screenshot of the results of the msgbox please?
Jon Capps OP  @Reply  
       
4 years ago
with more frustrating digging, I figured out that my query had some criteria that asking from another form. I am closer to an answer now, I got the sql statment to work, sorta
Dim SweekInput As String
Dim Syear As String

SweekInput = Forms!PayInspectorbasedInvoiceProfit.WeeKInput
Syear = Forms!PayInspectorbasedInvoiceProfit.YearFilter

sqlstring = "SELECT * FROM WeekPayForInspector WHERE wknuminsp =" & SweekInput

however I am goofing up the where clause to get two conditions to work
I want the where to look for two unbound items on my form
sqlstring = "SELECT * FROM WeekPayForInspector WHERE wknuminsp =" & SweekInput AND YearInvoice = Syear
Jon Capps OP  @Reply  
       
4 years ago

Jon Capps OP  @Reply  
       
4 years ago

Jon Capps OP  @Reply  
       
4 years ago

Adam Schwanz  @Reply  
           
4 years ago
Yea I figured it was query criteria once we got there.

"SELECT * FROM WeekPayForInspector WHERE wknuminsp =" & SweekInput & " AND YearInvoice =" & Syear

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 8/24/2026 9:22:08 AM. PLT: 0s