Modules & VBA :: No Record Found - How To Bypass Error 3021

Jan 3, 2014

How to by pass error 3021 No current record

I know I can put the code below just don't know where to put it.

If Err.Description = "No current record" Then Resume

I attached a pic of my code that is causing the error .. and its okay I just want to by pass the message box.

View Replies


ADVERTISEMENT

Modules & VBA :: No Current Record (3021) Error

Sep 18, 2014

I get this error when I delete more than one record consecutively.

Here is my delete code;

Private Sub Komut98_Click()
Dim blnLast As Boolean
'MsgBox call must return the value in order to be checked.
'If user says no then cancelling is not required. It is only required
' that the deletion command is not invoked.

[Code] ....

View 5 Replies View Related

Modules & VBA :: Run-time Error 3021 While Updating Existing Record In DAO Recordset

Jun 16, 2014

I have a linked table to a DB2 database. this table contains key-pair values and has about 140k records.

I use a Sub to update the value of a specific record.

The sub starts by opening the needed DAO recordset
Then it uses the rs.Findfirst method
It checks if rs.Nomatch is not true (so the records exists!)
Then it starts updating the record with
rs.edit
rs!value1 = myvalue1,
rs!value2 = myvalue 2
rs.Update
There is where I get the '3021 No current record' error

I use the same sub on the same table to update to different parts. One part works the other gives me the error.

I have checked for typos.

View 5 Replies View Related

Modules & VBA :: Sorting Out Data To Be Used In Final Table - Runtime Error 3021

Nov 25, 2014

I have managed to sort out the data to be used in the final table. However, I am having trouble transferring the data from each of their own tables into the final table.

Each time I run my code I receive "run-time error 3021: No current record."

It seems that only my timestamp is being added properly, but the error pops up and highlights the first "rstInsert.Edit" of my code. I'm suspecting that my function is running too fast, such that it did not have time to read that the table has already been populated by the timestamp in the AddNew code

Code:
Private Sub Command9_Click()
Dim dbs As DAO.Database
Dim rstTimestamp As DAO.Recordset
Dim rstAcknowledgement As DAO.Recordset
Dim rstAgent As DAO.Recordset

[Code] ....

View 1 Replies View Related

Modules & VBA :: How To Bypass Before Update Event When Record Is Deleted

Sep 21, 2014

I have a database which is slowly evolving. Users needed a feature to delete some records without a trail and some with a trail from the form. So I added an apply action field in the subform using which they can delete a record without a trail and if they wanted to keep a trail they could do that too. When user selects "Delete Violations as it was entered in error" the system deletes the record completely which is what everyone wanted.

After six months of use now I am asked to add an audit trail. I managed to do that also. I also looked at Browne's method but my data structure does not match the requirements for that method. I used an alternate method. It works as intended except when a record is completely deleted using the code I mentioned above. Then it goes in the infinite loop. I somehow need to bypass the before update event so that the function to write the audit trail is not called.

I have attached the database ...

View 14 Replies View Related

Error Message: The Search Key Was Not Found In Any Record

Jul 11, 2006

Hello all,

I try to delete a record and i get this error message "The search key was not found in any record". The key of the table is an autonumber but for some reason in these two records i want to delete has value = 0 .

Any suggestion how to delete these two records?

Thank you in advance!

View 3 Replies View Related

Search Keys Not Found In Any Record - ERROR

May 25, 2006

I have a fairly complex database which contains a company table and a staff table along with approx 30 other smaller tables.

The staff records have a field called company which is linked in a one to many relationship to the CompanyId field in the Company table. This is an auto-number field and is up to 5467 currently.

I have enforced data integrity when this relationship was created. The users enter new staff members using a sub-form in the Company form.

A user created a new record for a company and while completing the task the text in all field went a bit crazy and appeared in symbols rather than text. The user shut down the database and restarted it.

Now when you open the company form the staff member appears with the correct company but does not appear anywhere else in the database with this company. The correct company id is 3416 but when I looked in the table the staff members record has an id of 36097146 or something similar. There are only 5467 companies in the company table. I tried to amend this figure and got and error which said "The search keys could not be found in any records".

I tried to delete the record and the same error appeared. When I clicked on the Help button of the error I got a message telling me that the error occurs when an ISAM seek operation fails.

Anybody know what is going on here and how I can delete this record or more importantly why this may have happened in the first place.

View 1 Replies View Related

Error 3021

May 5, 2005

Hello,

I have search previous threads on this problem and not been able to solve it....so if there are any new ideas on this I would appreciate your help.

Firstly I open a new form "Document Details" from a subform which filters out a single record thus

Private Sub Command116_Click()
On Error GoTo Err_Command116_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Document Details"
stLinkCriteria = "[Fileandrev]=" & "'" & Me![Filename] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command116_Click:
Exit Sub

Err_Command116_Click:
MsgBox Err.Description
Resume Exit_Command116_Click

End Sub

If I then try and delete the record using the following

DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdDeleteRecord

It of course...as many others have discovered goes into the error 3021
because there is no current record for the form to move to because it
is filtered from the above statement

DoCmd.OpenForm stDocName, , , stLinkCriteria

All I need to do is close the form after the error message and refresh the subform so it removes the deleted record which I know I can do by placing the commands after the error description....but it would be nice to know how
to do it properly rather than bodge it ..!!

Any ideas please

Thanks in anticipation :)

View 2 Replies View Related

Help With Error 3021

Oct 11, 2006

Hi, I'm learning Access on the fly for a temp job, and it's going pretty well, but I can't get past this problem:

I have a form for deleting a record, and it has a delete button with this code:

Private Sub Delete_Click()
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.Close acForm, "frmDelete"
End Sub

The record IS deleted, but the form is not closed. Instead, I get this message:

Run-time error 3021
No current record

I think I understand, logically, why this is happening - the counter at the bottom of the form is still set on record #x after x has been deleted, and it stops the code. But I can't for the life of me figure out how to fix it.

Thanks for your help!

View 7 Replies View Related

Error 3021

Apr 8, 2006

I have a code which now works perfectly on my subsubform. My navigation buttons are fine until I put code for showing the record number and total number of records on the form, subform and subsubform. When scrolling through records I get error 3021 suggesting no record found. There may not be a record on the subform yet but there are always records on the form I am trying to navigate.

Any Ideas how I can avoid this error or even get access to ignore it!!!

View 1 Replies View Related

Modules & VBA :: Syntax Error - Variable Not Found

Feb 18, 2014

Somehow it doesn't take this variable msoFileDialogSaveAs. It tells me it's unknown.

Code:
Public Sub Command2_Click()
On Error GoTo MyError3
Dim filelocation As Variant
Dim g As Object
Set g = Application.FileDialog(msoFileDialogSaveAs)

[Code] .....

View 2 Replies View Related

Modules & VBA :: Data Source Name Not Found Error

Mar 31, 2015

i recieved error on the following connection string in the combo box change event code as follows,

Private Sub LotNo_Change()
Dim conn As New ADODB.Connection
Dim sConnString As String

[Code]....

View 6 Replies View Related

Search Key Not Found In Any Record Error (Trying To Port Database File)

Jul 24, 2015

My database is in database where we do the editing and using Access for query reports.

Upon importing from External Data Link to the data source by creating a linked table: the table was created but running a query yields the above error.

View 1 Replies View Related

Modules & VBA :: Error Message When No Data Found In Query?

Jul 18, 2013

I have a search query that searches for different results based on 3 criterior. I have set up a form so that the user can input the text into the form and then once the Submit button (that i created) is clicked the query table will be shown.

My question is:

Is it possible to have an error message box appear when i click submit and no data is returned by the search query?

I'm hoping for the message box to say "No corresponding records to your search criteria. Do you want to try again?"

Then the options given in the message box are Yes (where they should be taken back to the search form) and No (Where they are taken to another form).

View 6 Replies View Related

Modules & VBA :: Copying / Renaming - File Not Found Error

Oct 28, 2014

I haven't used FSO before, and it seems that the syntax is a little different than typical VBA for strings, but I can't quite figure out what I'm doing wrong here... I keep getting a "file not found" error on the "FSO.CopyFile..." line. I have printed all of my strings to the immediate window to check that they're printing correctly. It all looks good. My code is as follows:

'Copy file
'Set up strings for coding file names
Dim FilePath As String
FilePath = Me.txt_FilePath
Dim FileName As String
FileName = Me.txt_FileName

[Code] ....

View 9 Replies View Related

Error 3021 Is Driving Me Nuts

Jan 14, 2006

Hi
I am having a real hard time with access weared errors. I am using following code:

Me.HistorySymptoms.Form.Refresh 'Just to make sure. It was a try because of error
If Me.HistorySymptomTab.Visible = True Then 'It is a subform in a tab page
For counter = 0 To 29 'Number of fields in the recordset
If IsNull(rs.Fields(1 + counter).value) = False Then ' Just to check Null values
MsgBox rs.Fields(counter).Name 'For debugging
Old_History(counter) = rs.Fields(1 + counter).value 'This line has problem
End If
MsgBox rs.Fields(counter).Name & " Done.||" & counter
Next counter
End If

The error comes in the maked line on accessing the field value. Previously I had another error but after going through the process of "Corrupt Access file correction", I am getting this one. My form has subforms in tabpages. I want to save all the field values to the array on pressing a button. Button is part of the main form and code copies values from a subform. I don't think my file is corrupt as I went through the process twice :-(
Looking for help
RMA

View 2 Replies View Related

Modules & VBA :: Error 461 Method Not Found On Outlook Folder Object

Sep 15, 2014

I have a strange behaviour on a module which reference to Microsoft Outlook Object Library 14.0. The below code got an error 461 on the folderoutlook.display code,i.e. the method is not found. The funny thing is that the same code gives no problem in another accdb file, exactly same code with same reference on same machine.

Set appOutlook = GetObject(, "Outlook.Application")
Set appOutlook = New Outlook.Application
Set namespaceOutlook = appOutlook.GetNamespace("MAPI")
Dim folderOutlook As Folder
Set folderOutlook = namespaceOutlook.GetDefaultFolder(olFolderInbox)
FolderOutlook.Display

View 4 Replies View Related

Tables :: Edit Values In Linked Table Error 3021

Jul 8, 2014

I have ODBC linked tables to a DB2 database.When I try to edit the values in some of the tables (open the table in dataview and edit one record) I get a 3021 Error -No current record.On other tables (linked the same way) I don't get this error

If I try the update by running a query on the same table, I get no errors.

The system I have is a german Access 2010 on german WinXP and a connection to DB2 LUW v9.7

Is there any set of settings necessary for ODBC to work with access and vice versa?

View 3 Replies View Related

Modules & VBA :: Client Table - Add New Record If None Found

Nov 23, 2013

The Setup: There is a clients table, a property table and a jobs table. Each client can have multiple properties and there can be multiple jobs done on each property.

The form: I created a form that uses a drop down to select the client, once the client is selected the subform shows the properties for that client. I can navigate through the properties to select any of the required properties and on this same subform, there is a button to open the jobs related to the property selected.

The problem: The form and subform work fine. The last form (the button that opens up the jobs) works ONLY IF there are records available. If there are no jobs for that property, it doesn't allow me to enter a new record. I'm pretty sure that the issue is because the jobs form has a query record source that uses all three tables linked (I'm pulling the clients name from the clients table and the property name from property table).

What I need is some vba coding to check if the recordset is empty and if it is then add this entry. Also, I'm not sure if this should add this code to the button or on the on_load of the jobs form.

View 8 Replies View Related

Modules & VBA :: Creating A Search Form With Ability To Add Found Record To Table?

Aug 7, 2013

creating a VBA that will allow me to search for a record in Table A, and once the record is found, allow me the option to add that record to Table B. Is this possible to do if Table A and Table B are not formatted the same (i.e. one has more fields than the other)? In summary, creating a VBA that will allow me to search in one table and once the correct record is found, allow me the ability to add it to another table.

View 7 Replies View Related

Error: "The Search Key Was Not Found In Any Record"

Sep 28, 2006

Help! A very strange record has materialised in my database. Consisting of characters like these:
༏`䳾䬲No00:00:00佔㌳774400:00:0000:00:00N/AŸÞ呌ㅏR㋾〰YesYesNoYes00:00:0000:00:0000:00:0000:00:00YesYesYes00:00:00〶〹S叾䅔⁂佐䱏删乕丠塅⁔䅄⹙倠䕒䅐䭃匠呅唠⁐义佃剒000:00:00䍅䱔y䓾
The database is linked to an excel spreadsheet which updates the database. When I try to delete the record I get a message;"The search key was not found in any record" I can't even overwrite the field with proper data either. Please can anyone please explain to me how this record has appeared (in simple terms - I am a very simple person) and how do I get rid of it?

View 2 Replies View Related

VBC Error: Sbf Cannot Be Found

Apr 19, 2005

Hi!

I'm in the midst of a database where a subform 'producttotal' textbox 'txttotal' would be automatically filled with a value from the mainform combobox 'product'. my code is
Private Sub Level_AfterUpdate()
Forms!sbfproducttotal![txttotal] = Me![product].Column(1)
End Sub

However, on testing it, I get a runtime error 2450. MS Access can't find the 'sbfproducttotal' referred to.

Do you have any idea what the problem is? Any words of advice would be welcome. Thanks!

View 3 Replies View Related

Module Not Found Error

Aug 29, 2005

I was doing a compact and repair when I got this error message.

Now when I try to open my database all I get is this message:
"Module not found"
:eek:

Am I screwed or is there maybe possible silver bullet??

Thanks for any help

View 1 Replies View Related

Error 53 / File Not Found

Jan 2, 2008

I have been using the below code for several months to export to excel. Lately I get a run-time error 53 - File not Found. I have not changed anything, so what could be causing this issue. The debugger stops on the line "FileCopy sTemplate, sOutput"

Public Function ExportRequest() As String
On Error GoTo err_Handler

Dim dbs As Database
Dim qdf As QueryDef
Dim frm As Form
' Set database variable to current database.
Set dbs = CurrentDb()
Set frm = Forms!AOSummaryReportForm
' Open QueryDef object.
Set qdf = dbs.QueryDefs("AOSummary")
' Set parameters for query based on values entered
' in AOSummaryReportForm.
qdf.Parameters(0) = Forms!AOSummaryReportForm!StartDate
qdf.Parameters(1) = Forms!AOSummaryReportForm!EndDate


' Excel object variables
Dim appExcel As Excel.Application
Dim wbk As Excel.Workbook
Dim wks As Excel.Worksheet

Dim sTemplate As String
Dim sTempFile As String
Dim sOutput As String

Dim rst As DAO.Recordset
Dim strSQL As String
Dim lRecords As Long
Dim iRow As Integer
Dim iCol As Integer
Dim iFld As Integer

Const cTabOne As Byte = 1
Const cStartRow As Byte = 2
Const cStartColumn As Byte = 1

DoCmd.Hourglass True

' set to break on all errors.....

View 14 Replies View Related

File Not Found Error

Jul 9, 2014

I've created an application in Access 2010 with a back-end and user-level security via workgroup file. The application has 12 users, the back-end is on a network share, and everyone has the front-end installed locally. Everything has been working great until today, when I made a small change and installed it on users' machines. Suddenly, one and only one user is getting the File Not Found error (53) whenever he opens the database, and all form buttons produce the same result.

View 7 Replies View Related

Forms :: Combo Box Search - If Record Not Exist It Will Display Msgbox To No Record Found

Oct 28, 2014

I have a problem with my database I have a combo box that will search for my record. Actually its working I input the specific number it goes to the specific record. But I want, if there no existing record in my database it will display a Messagebox that "No record Found" I try to put a code in a macro builder in a after update property field but nothing happened.

Expression code that it will display the msgbox if there's no record found.

the given code from macro builder is attached. I try to have an if else statement but I dont know how to not equal that giver conditional expression.

View 10 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved