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.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Method or Data Member Not Found

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-27-08, 12:51
cramah cramah is offline
Registered User
 
Join Date: Mar 2007
Posts: 3
Method or Data Member Not Found

Hello all;

I'm getting an error "Method or Data Member Not Found" at line "rs.Edit" in the below code. Does anyone have a guess as to why? I tried changing the Recordset to DAO but that gives me a type mismatch error? Perplexed? Thanks in advance for any suggestions.


On Error GoTo Err_cmdSave_Click
Dim vntRetVar As Variant
Dim db As Database
Dim rs As Recordset
Set db = CurrentDb()
Set rs = db.OpenRecordset("tblImageBLOBs")
'If Validated, Save; if not, just return to Form
If Validate Then
vntRetVar = ReadBLOB(Me![imgTheImage].Picture, rs, "ImageItem")
If vntRetVar <= 0 Then GoTo SpecialError
rs.MoveLast
rs.Edit
rs("ImageShortName") = Me![txtImageShortName]
rs("ImageName") = Me![txtImageName]
rs("ImageFileExtension") = Right(Me![imgTheImage].Picture, 3)
rs.Update
On Error Resume Next
DoCmd.Echo False
Forms![frmImageBLOBSummaryList].Requery
DoCmd.Echo True
DoCmd.Close acForm, Me.Name
End If
Exit_cmdSave_Click:
On Error Resume Next
rs.Close
Set rs = Nothing
Set db = Nothing
Exit Sub
Err_cmdSave_Click:
MsgBox "Err: " & Err.Number & " : " & Err.Description & _
" in Sub cmdSave_Click", vbCritical, "Images in Access Example"
Resume Exit_cmdSave_Click
SpecialError:
MsgBox "Error " & -vntRetVar & " trying to write the BLOB", vbExclamation, "Images in Access Example"
Resume Exit_cmdSave_Click
End Sub
Reply With Quote
  #2 (permalink)  
Old 02-27-08, 12:56
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 10,525
thats almost certainly a missing reference or library

check what libraries are associated with this code int he code editor.

make sure you don't confuse ADO with DAO or vice versa, be consistent with your data objects use either or but not both (unless of course you need TO)

However its possible that you have moved beyond the current recordset (its possible that a recordset may empty.. that could casue an error

incidentally when posting code please enlcose it in code tags <squarebracket'['>code<squarebracket']'>
I think its the # button on the normal reply function. it makes reading code much much easier
Reply With Quote
  #3 (permalink)  
Old 02-27-08, 13:01
cramah cramah is offline
Registered User
 
Join Date: Mar 2007
Posts: 3
Thanks very much for the input....sorry about the lack of code tags...whoops
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On