473,385 Members | 1,843 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Delete Record Button and Getting a "compile error"

121 100+
This is a very simple question....

I have a form that looks up Records for an unbound drop-down list.
It has worked just fine up until last night.

Now the button on the form to delete a record doesn't work. i get a
"compile error: method or data member not found".

The code for the drop-down is this:
Expand|Select|Wrap|Line Numbers
  1. Private Sub REC_ID_COMBO_AfterUpdate()
  2.     Dim rs As DAO.Recordset
  3.  
  4.     If Not IsNull(Me!REC_ID_Combo) Then
  5.         'Save before move.
  6.         If Me.Dirty Then
  7.             Me.Dirty = False
  8.         End If
  9.         'Search in the clone set.
  10.         Set rs = Me.RecordsetClone
  11.         rs.FindFirst "[REC_ID] = """ & Me!REC_ID_Combo & """"
  12.         If rs.NoMatch Then
  13.             MsgBox "Not found: filtered?"
  14.         Else
  15.             'Display the found record in the form.
  16.             Me.Bookmark = rs.Bookmark
  17.         End If
  18.         Set rs = Nothing
  19.     End If
  20. End Sub


The code to delete a record is:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Command389_Click()
  2. On Error GoTo Err_Command389_Click
  3.  
  4.  
  5.     DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
  6.     DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
  7.  
  8. Exit_Command389_Click:
  9.     Exit Sub
  10.  
  11. Err_Command389_Click:
  12.     MsgBox ERR.Description
  13.     Resume Exit_Command389_Click
  14.  
  15. End Sub
One more bit of information... when I point the record source to another table (that is mostly identical) the button works fine. But when I point it back to my ERR_REC table, I get the error again.


Can anyone please help. I have been working on this for 6 hours and have found no answers.
Apr 20 '07 #1
6 1757
Rabbit
12,516 Expert Mod 8TB
Does it tell you which line is causing the problem?
Apr 20 '07 #2
JHNielson
121 100+
First, I apologize about the double post. I didn't realize I had double posted. My browser hung in submitting the post, so I resent it. It must have got through the first time.


Second, when I run the command, the yellow error points to the first line the: Private Sub Command389_Click()

The cursors highlights the msgbox error.description.


Thanks for the help
Apr 20 '07 #3
Rabbit
12,516 Expert Mod 8TB
Well, the error means that it can't find the description property of the object err. I know it exists so perhaps you're missing a reference, did you check those?
Apr 20 '07 #4
JHNielson
121 100+
Well, the error means that it can't find the description property of the object err. I know it exists so perhaps you're missing a reference, did you check those?

You're right I found the missing reference. I knew it was something simple, but after staring at it so long I was running out of ideas.

Thanks for your help. You're a life saver
Apr 20 '07 #5
Rabbit
12,516 Expert Mod 8TB
You're right I found the missing reference. I knew it was something simple, but after staring at it so long I was running out of ideas.

Thanks for your help. You're a life saver
Not a problem, good luck.
Apr 20 '07 #6
Denburt
1,356 Expert 1GB
If I might may I make a suggestion that could save you a headache in the future?

Instead of using:

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

Try using:

DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdDelete

So much more reliable, Domenuitem relies on Microsoft never changing menus....
Sketchy at best.
Apr 20 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Bartosz Krzywicki | last post by:
I have a problem with the following error: "Server Error in '/sir' Application. -------------------------------------------------------------------------------- The viewstate is invalid for...
1
by: sathyp | last post by:
Public Function SetPrinterDefaultsW(ByVal sPrinterName As String, _ ByVal nPaperSize As Long, ByVal nOrientation As Long) As Boolean Dim Prn As Printer Dim hPrinter As Long Dim pd As...
0
by: DC | last post by:
The problem I'm using the .NET GridView and FormView objects for the first time and im getting the error "An OleDbParameter with ParameterName '@ID' is not contained by this...
0
by: sherifffruitfly | last post by:
Hi, I'm deleting a bunch of records from my DB, and they actually DO get deleted (as I verify by looking afterwards). But then I get the exception in the subject line. Isn't it weird that all of...
0
by: swatitalati | last post by:
Hello when i invoke a method of web service i m getting error like Server was unable to process request. --> Requested registry access is not allowed. syntex for invoking method is as below ...
1
by: JHNielson | last post by:
This is a very simple question.... I have a form that looks up Records for an unbound drop-down list. It has worked just fine up until last night. Now the button on the form to delete a record...
1
by: imranabdulaziz | last post by:
Dear All, I am using sql2005. i am writing stored procedure to save various master data . I recognize master by @type (input verible) and assign it to @mst veriable then based on @mst no I...
5
patjones
by: patjones | last post by:
Hi: I've got a backend database, with several tables linked together via one-to-many relationships, and a front end database that links to those tables. The problem is, when I attempt to look...
9
by: Rohit | last post by:
I am trying to initialize an array whose initializers depend on value of Enums. I take enum and then decide the initializer value, so that even if enum value changes because of addition to list...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.