3021 Runtime Error
Contents |
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 runtime error 3021 no current record site About Us Learn more about Stack Overflow the company Business Learn more run time error 3021 about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x runtime error 3021 access Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Run time
Runtime Error 3021 Vba
error 3021- no current record up vote 1 down vote favorite 1 I want to link the result of a query to a Textbox but I get this error: here is my code: Dim rst As DAO.Recordset Set rst = CurrentDb.OpenRecordset("SELECT XValue, YValue,Wert FROM tb_DCM_Daten WHERE (FzgID=" & Forms!frm_fahrzeug!ID & " AND Name='" & List2.Value & "')") Text10.Text = rst!XValue //error in this line It runtime error 3021 vb6 should be return c.a 20 record Why do I get this error and how can I solve it? thnak you vba ms-access ms-access-2010 share|improve this question asked Jun 27 '13 at 6:46 Kaja 72142035 3 Rearrange your code so your SQL Statement is in a string variable, and print it out to the immediate window. That way you'll see if there's anything wrong with it. If nothing obvious, that the output SQL and put it in a query and verify that there is a record that matches your criteria. –GregHNZ Jun 27 '13 at 6:58 Thank you, that helps –Kaja Jun 27 '13 at 7:17 add a comment| 3 Answers 3 active oldest votes up vote 5 down vote accepted One possible reason for the error is that Name is a reserved word in Access, so you should use ... & " AND [Name]='" & ... You could also test for rst.EOF before trying to use rst!XValue. That is, to verify whether or not your query is returning at least one row you can add the code If rst.EOF Then MsgBox "The Recordset is empty." End If immediatel
One games Xbox 360 games PC runtime error 3021 either bof or eof is true games Windows games Windows phone games Entertainment All
How To Fix Runtime Error 3021
Entertainment Movies & TV Music Business & Education Business Students &
Runtime Error 3021 Access 2007
educators Developers Sale Sale Find a store Gift cards Products Software & services Windows Office Free downloads & security http://stackoverflow.com/questions/17336316/run-time-error-3021-no-current-record Internet Explorer Microsoft Edge Skype OneNote OneDrive Microsoft Health MSN Bing Microsoft Groove Microsoft Movies & TV Devices & Xbox All Microsoft devices Microsoft Surface All Windows PCs & tablets PC accessories Xbox & games Microsoft Band Microsoft https://support.microsoft.com/en-us/kb/964264 Lumia All Windows phones Microsoft HoloLens For business Cloud Platform Microsoft Azure Microsoft Dynamics Windows for business Office for business Skype for business Surface for business Enterprise solutions Small business solutions Find a solutions provider Volume Licensing For developers & IT pros Develop Windows apps Microsoft Azure MSDN TechNet Visual Studio For students & educators Office for students OneNote in classroom Shop PCs & tablets perfect for students Microsoft in Education Support Sign in Cart Cart Javascript is disabled Please enable javascript and refresh the page Cookies are disabled Please enable cookies and refresh the page CV: {{ getCv() }} English (United States) Terms of use Privacy & cookies Trademarks © 2016 Microsoft
Question Need help? Post your question and get tips & solutions from a community of 418,417 IT Pros & https://bytes.com/topic/access/answers/920315-how-do-i-avoid-error-3021-no-current-record Developers. It's quick & easy. How do I Avoid Error 3021: No Current Record P: 2 psdsen Please help me for the following program problem. When I Click Next button, http://visualbasic.ittoolbox.com/groups/technical-functional/vb-access-l/run-time-error-3021-no-current-record-vba-4333968 at the last record, it Shows --Run time error '3021': Either BOF or EOF...... Expand|Select|Wrap|Line Numbers OptionExplicit DimstrsqlAsString Dimcon_dataAsADODB.Connection Dimrs_DataAsADODB.Recordset PrivateSubForm_Load() Setcon_data=NewADODB.Connection Setrs_Data=NewADODB.Recordset con_data.Provider="Microsoft.jet.oledb.4.0;DataSource="&App.Path&"\salary97.mdb" con_data.Open strsql=("select*fromemployee") rs_Data.Openstrsql,con_data,adOpenDynamic,adLockOptimistic EndSub time error PrivateSubcmdnext_Click() Ifrs_Data.EOFThen rs_Data.MoveLast Else rs_Data.MoveNext EndIf txtnm.Text=rs_Data!ename EndSub Oct 22 '11 #1 Post Reply Share this Question 5 Replies Expert Mod 2.5K+ P: 2,543 Stewart Ross The error message is quite correct (although you have not posted all of it, just the start of it!). When you are already at the end of file position (in your case when rs_Data.EOF is time error 3021 true) you have gone past all active records, so you cannot execute a move to the last record. If you really want the last record to be the one displayed at end of file you will need to execute rs_Data.MoveFirst immediately before executing rs_Data.MoveLast. However, if there are no records at all in the table the MoveFirst will also fail with the same error message. This is where testing for both EOF and BOF being true at the same time comes in - both conditions are true simultaneously if the recordset is empty. -Stewart Oct 22 '11 #2 reply Expert Mod 15k+ P: 29,922 NeoPa Please read When Posting (VBA or SQL) Code before posting again. Oct 22 '11 #3 reply Expert 5K+ P: 8,394 ADezii This actually a little tricky since this Type of Recordset does not support the AbsolutePosition Property, and will also not give a valid RecordCount. What you can do is to Trap specific Errors, such as 3021, then move the Pointer to the Last Record and Update the Text Box: Expand|Select|Wrap|Line Numbers PrivateSubcmdNext_Click() OnErrorGoToErr_cmdNext rs_Data.MoveNext Me!txtn
Technology and Trends Enterprise Architecture and EAI ERP Hardware IT Management and Strategy Java Knowledge Management Linux Networking Oracle PeopleSoft Project and Portfolio Management SAP SCM Security Siebel Storage UNIX Visual Basic Web Design and Development Windows < Back CHOOSE A DISCUSSION GROUP Research Directory TOPICS Database Hardware Networking SAP Security Web Design MEMBERS Paul_Pedant MarkDeVries DACREE Inside-ERP MacProTX VoIP_News Inside-CRM I_am_the_dragon PCMag maxwellarnold Michael Meyers-Jouan TerryCurran Chris_Day JoeTorre Andrew.S.Baker Richard bracke Ramnath.Awate DukeGanote Locutus Nikki Klein Dennis Stevenson Craig Borysowich AbhaiTripathi Clinton Jones bluesguyAZ59 iudithm knowscognosdoi mircea_luca Iqbalyk COMPANIES CloudLock Trend Micro Incorporated Citrix Panaya Inc. View All Topics View All Members View All Companies Toolbox for IT Topics Visual Basic Groups Ask a New Question Visual Basic for Access For discussion on Visual Basic for Access , please visit the Visual Basic – General Discussions group. More Visual Basic Groups Your account is ready. You're now being signed in. Solve problems - It's Free Create your account in seconds E-mail address is taken If this is your account,sign in here Email address Username Between 5 and 30 characters. No spaces please The Profile Name is already in use Password Notify me of new activity in this group: Real Time Daily Never Keep me informed of the latest: White Papers Newsletter Jobs By clicking "Join Now", you agree to Toolbox for Technology terms of use, and have read and understand our privacy policy. Run Time Error 3021 , No current Record VBA Irfan Rana asked Jul 27, 2011 | Replies (6) I have two tables, One is a Data "LST_ SS" and other is the result "MML". I want to concatenate a field FAC of LST_ SS for each DN and update in Table "MML" , into field FAC. Here i am trying to get rid of it. Please assist how do control rsMML , there is error on rsMML update. Private Sub cmdMML_Click() DoCmd.OpenQuery "qryDISTINCT", acViewNormal Dim rsList As Recordset Dim rsDBList As Database Dim rsData As Recordset Dim rsDBData As Database Dim rsMML As Recordset Dim rsDBMML As Database Set rsDBList = CurrentDb Set r