Ms Access No Current Record Error Query
be down. Please try the request again. Your cache administrator is webmaster. Generated Thu, 20 Oct 2016 21:36:20 GMT by s_wx1157 (squid/3.5.20)
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up No Current Record Error in MS Access 2010 while using a self join up vote 0 down vote favorite I'm replacing a subquery with an self join to improve performance of my query. The old http://answers.microsoft.com/en-us/office/forum/office_2010-access/access-2010-no-current-record-error-message-on/febb0da1-abe1-438f-96fb-0927ef37deff subquery was like this: (SELECT fage2.agecat FROM people AS fage2 WHERE fage2.aacode = people.aacode AND fage2.persno = 2) AS RAge2, The new self join is like this: (SELECT [People].[AgeCat] FROM [People] INNER JOIN [People] AS p2 ON [People].[aacode] = [P2].[aacode] WHERE [P2].[PERSNO] = 2 ) AS RAge2, but returns a No Current Record error message. The goal is to find the record that has the same aacode but has the PERSNO number of 2 and return the AgeCat for that http://stackoverflow.com/questions/8137548/no-current-record-error-in-ms-access-2010-while-using-a-self-join record in a column called RAge2, This is only part of a larger query which is explained in full Convert a SQL subquery into a join when looking at another record in the same table Access 2010 sql ms-access-2010 self-join share|improve this question edited Nov 15 '11 at 22:36 Conrad Frix 39.9k105299 asked Nov 15 '11 at 14:06 falcs 168315 1 duplicate to stackoverflow.com/questions/8136392/… and also stackoverflow.com/questions/8137548/… please consider editing your original instead of opening new ones... –ClaitonLovatoJr Nov 16 '11 at 13:45 add a comment| 2 Answers 2 active oldest votes up vote 0 down vote accepted Huum, looks like this query that you want to optimize is part of a bigger query, and would be important to the question that you post the entire query so it would help on understanding your problem ... Also, from what I can see you would be showing the RAge2 for both rows with same AACode not only to the one that has Persno = 2 as you said on the goal. Pasting your entire query would help to understand that also. I was trying to understand your query, so I created a fake query for your original one: SELECT (SELECT FAge2.AgeCat FROM People AS FAge2 WHERE FAge2.aacode = People.aacode AND FAge2.PERSNO = 2) AS RAge2, People.PersonId FROM People To get the same results you would need a Left Join and not a Inner Join as a query with a su
Social Groups Pictures & Albums Members List Calendar Search Forums Show Threads Show Posts Tag Search Advanced Search Find All Thanked Posts Go to Page... Thread Tools http://www.access-programmers.co.uk/forums/showthread.php?t=117198 Rate Thread Display Modes 11-03-2006, 06:01 AM #1 RickDB Registered User Join Date: Jun 2006 Location: Indianapolis Posts: 101 Thanks: 0 Thanked 0 Times in 0 Posts "No current http://www.vbforums.com/showthread.php?753919-RESOLVED-Run-time-Error-3021-No-Current-Record-query-string-question record." Why? Hello, I am making a query using the following: tblCustomers tblOrders These tables are linked together using CustomerID PK to FK. Now the problem: When I run a query using ms access a left join to tblCustomers & tblOrders I have no problems until I try to include any one of these 3 fields: CalledBack Sold Shipped Then when I try to run the query, "No current record." is returned... These 3 fields are Yes/No checkboxes that are used as triggers to assign a employee variable to CalledBy, SoldBy, ShippedBy and also to store Now() values for ms access no CalledDate, SoldDate, ShippedDate Looking at this, I suppose the Yes/No field is unnecessary, and I could have simply used a cmdButton to assign the two important values (employee & time) to my table. I would still like to understand why this happens though... Thanks! RickDB View Public Profile Find More Posts by RickDB 11-03-2006, 06:39 AM #2 gemma-the-husky Super Moderator Join Date: Sep 2006 Location: UK Posts: 13,140 Thanks: 50 Thanked 885 Times in 857 Posts Calling the three items checkboxes is confusing. Generally you can only get raw data into your visual query from the fields in the tables. (you can get other things with functions etc). What you want is to drag the underlying yes/no field into the query. This will display as a little check box in the query. I suspect the names you are using ie callback, sold, shipped are not things in your tables. gemma-the-husky View Public Profile Find More Posts by gemma-the-husky 11-03-2006, 07:00 AM #3 RickDB Registered User Join Date: Jun 2006 Location: Indianapolis Posts: 101 Thanks: 0 Thanked 0
No Current Record, query string question. If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 15 of 15 Thread: [RESOLVED] Run-time Error 3021, No Current Record, query string question. Tweet Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Feb 10th, 2014,11:16 AM #1 Aaron02 View Profile View Forum Posts Thread Starter Lively Member Join Date Mar 2007 Location Illinois, USA Posts 85 [RESOLVED] Run-time Error 3021, No Current Record, query string question. I'm working with a few year old VB6 project, using Access 2000 tables. When my query string is run against a couple tables, I get a 'No current record' error. I believe now I have a syntax problem in my query string's WHERE , as running a query in Access yields the desired result. Access query SQL - OK: Code: SELECT tblEventPage.InputID, tblInputs.Card_No, tblInputs.Bank_No, tblInputs.Bit_No, tblInputs.Label, tblGroups.Group, tblInputs.Page, tblPreferences.KeyRecip, tblRecipients.Email FROM tblGroups INNER JOIN (tblInputs INNER JOIN tblEventPage ON tblInputs.ID = tblEventPage.InputID) ON tblGroups.ID = tblInputs.Group, tblPreferences INNER JOIN tblRecipients ON tblPreferences.KeyRecip = tblRecipients.Recipient WHERE (((tblInputs.Card_No)=[Card]) AND ((tblInputs.Bank_No)=[Bank]) AND ((tblInputs.Bit_No)=[Bit])); This is my VB6 query string, with input view message box, so I know its receiving the criteria. Code: MsgBox "Card: " & Card & ", Bank: " & Bank & ", Bit: " & Bit '*** All OK *** strSQL = "SELECT tblEventPage.InputID, tblInputs.Card_No, tblInputs.Bank_No, tblInputs.Bit_No, tblInputs.Label, tblGroups.Group, tblInputs.Page, tblPreferences.KeyRecip, tblRecipients.Email " & _ "FROM tblGroups INNER JOIN (tblInputs INNER JOIN tblEventPage ON tblInputs.ID = tblEventPage.InputID) ON tblGroups.ID = tblInputs.Group, tblPreferences INNER JOIN tblRecipients " & _ "ON tblPreferences.KeyRecip = tblRecipients.Recipient " & _ "WHERE tblInputs.Card_No = " & Card & " AND tblInputs.Bank_No = " & Bank & " AND tblInputs.Bit_No = " & Bit & ";" Set RSs = DB.OpenRecordset(strSQL) pag = RSs!Page 'RSs.Fields("Page") 'Run-timer error 3021, No Current Record here (pag is empty). Any guidence on my WHERE would be appreciated. Reply With Quote Feb 10th, 2014,12:10 PM #2 RhinoBull View Profile View Forum Posts PowerPoster Join Date Mar 2004 Location New Amsterdam Posts 24,135 Re: Run-time Error