PC Review


Reply
Thread Tools Rate Thread

debug error on '.edit' statement

 
 
=?Utf-8?B?Q2l0eUd1eQ==?=
Guest
Posts: n/a
 
      13th Apr 2006
Hi,

I'm fairly new at VBA programming. I have run into a snag.

I want to use code to save edited data from unbound text boxes. The
following code fragment causes an error when I try to compile the module.

Error:
"Compile Error, Method or data member not found"

Code:
With SdrInfo
'
.Edit <----------- Debugger highlights this line
 
Reply With Quote
 
 
 
 
John Spencer
Guest
Posts: n/a
 
      13th Apr 2006
What is SdrInfo? Is it a recordset?

"CityGuy" <(E-Mail Removed)> wrote in message
news:BFEA0D76-FA8E-4A66-9271-(E-Mail Removed)...
> Hi,
>
> I'm fairly new at VBA programming. I have run into a snag.
>
> I want to use code to save edited data from unbound text boxes. The
> following code fragment causes an error when I try to compile the module.
>
> Error:
> "Compile Error, Method or data member not found"
>
> Code:
> With SdrInfo
> '
> .Edit <----------- Debugger highlights this line
> .
> .
> .
> .Update
> With End
>
> I have used this code before with success, but now it won't
> compile and I am not sure why. Can anyone help me with this?
>
> Thanks in advance.



 
Reply With Quote
 
Alex Dybenko
Guest
Posts: n/a
 
      13th Apr 2006
Hi,
if SdrInfo - is ADO recordset - then you don't need to call edit method,
just comment this line out

--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com


"CityGuy" <(E-Mail Removed)> wrote in message
news:BFEA0D76-FA8E-4A66-9271-(E-Mail Removed)...
> Hi,
>
> I'm fairly new at VBA programming. I have run into a snag.
>
> I want to use code to save edited data from unbound text boxes. The
> following code fragment causes an error when I try to compile the module.
>
> Error:
> "Compile Error, Method or data member not found"
>
> Code:
> With SdrInfo
> '
> .Edit <----------- Debugger highlights this line
> .
> .
> .
> .Update
> With End
>
> I have used this code before with success, but now it won't
> compile and I am not sure why. Can anyone help me with this?
>
> Thanks in advance.


 
Reply With Quote
 
=?Utf-8?B?Q2l0eUd1eQ==?=
Guest
Posts: n/a
 
      13th Apr 2006
Hi,

Sorry, SdrInfo is a recordset. I open it with

Set db = CurrentDb()
Set SdrInfo = db.OpenRecordset("tblSdrInspectionInfo", dbOpenDynaset)


"John Spencer" wrote:

> What is SdrInfo? Is it a recordset?
>
> "CityGuy" <(E-Mail Removed)> wrote in message
> news:BFEA0D76-FA8E-4A66-9271-(E-Mail Removed)...
> > Hi,
> >
> > I'm fairly new at VBA programming. I have run into a snag.
> >
> > I want to use code to save edited data from unbound text boxes. The
> > following code fragment causes an error when I try to compile the module.
> >
> > Error:
> > "Compile Error, Method or data member not found"
> >
> > Code:
> > With SdrInfo
> > '
> > .Edit <----------- Debugger highlights this line
> > .
> > .
> > .
> > .Update
> > With End
> >
> > I have used this code before with success, but now it won't
> > compile and I am not sure why. Can anyone help me with this?
> >
> > Thanks in advance.

>
>
>

 
Reply With Quote
 
=?Utf-8?B?Q2l0eUd1eQ==?=
Guest
Posts: n/a
 
      13th Apr 2006
I should also add that SdrInfo references a table residing on the
back end of this database

"John Spencer" wrote:

> What is SdrInfo? Is it a recordset?
>
> "CityGuy" <(E-Mail Removed)> wrote in message
> news:BFEA0D76-FA8E-4A66-9271-(E-Mail Removed)...
> > Hi,
> >
> > I'm fairly new at VBA programming. I have run into a snag.
> >
> > I want to use code to save edited data from unbound text boxes. The
> > following code fragment causes an error when I try to compile the module.
> >
> > Error:
> > "Compile Error, Method or data member not found"
> >
> > Code:
> > With SdrInfo
> > '
> > .Edit <----------- Debugger highlights this line
> > .
> > .
> > .
> > .Update
> > With End
> >
> > I have used this code before with success, but now it won't
> > compile and I am not sure why. Can anyone help me with this?
> >
> > Thanks in advance.

>
>
>

 
Reply With Quote
 
=?Utf-8?B?Q2l0eUd1eQ==?=
Guest
Posts: n/a
 
      13th Apr 2006
Hi,

Thanks for the tip. How does one know if a database is an ADO or DAO.
I still find the differeneces between these 2 confusing.



"Alex Dybenko" wrote:

> Hi,
> if SdrInfo - is ADO recordset - then you don't need to call edit method,
> just comment this line out
>
> --
> Best regards,
> ___________
> Alex Dybenko (MVP)
> http://alexdyb.blogspot.com
> http://www.PointLtd.com
>
>
> "CityGuy" <(E-Mail Removed)> wrote in message
> news:BFEA0D76-FA8E-4A66-9271-(E-Mail Removed)...
> > Hi,
> >
> > I'm fairly new at VBA programming. I have run into a snag.
> >
> > I want to use code to save edited data from unbound text boxes. The
> > following code fragment causes an error when I try to compile the module.
> >
> > Error:
> > "Compile Error, Method or data member not found"
> >
> > Code:
> > With SdrInfo
> > '
> > .Edit <----------- Debugger highlights this line
> > .
> > .
> > .
> > .Update
> > With End
> >
> > I have used this code before with success, but now it won't
> > compile and I am not sure why. Can anyone help me with this?
> >
> > Thanks in advance.

>
>

 
Reply With Quote
 
Duane Hookom
Guest
Posts: n/a
 
      13th Apr 2006
Your code should be something like:
Dim db as DAO.Database
Dim SdrInfo As DAO.Recordset
Set db = CurrentDb()
Set SdrInfo = db.OpenRecordset("tblSdrInspectionInfo", dbOpenDynaset)

This code explicitly uses the DAO library which has been around in Access
for more years than ADO. DAO IMHO works best for Access tables.


--
Duane Hookom
MS Access MVP

"CityGuy" <(E-Mail Removed)> wrote in message
news:9DA19ACB-AC75-4939-A5CE-(E-Mail Removed)...
> Hi,
>
> Thanks for the tip. How does one know if a database is an ADO or DAO.
> I still find the differeneces between these 2 confusing.
>
>
>
> "Alex Dybenko" wrote:
>
>> Hi,
>> if SdrInfo - is ADO recordset - then you don't need to call edit method,
>> just comment this line out
>>
>> --
>> Best regards,
>> ___________
>> Alex Dybenko (MVP)
>> http://alexdyb.blogspot.com
>> http://www.PointLtd.com
>>
>>
>> "CityGuy" <(E-Mail Removed)> wrote in message
>> news:BFEA0D76-FA8E-4A66-9271-(E-Mail Removed)...
>> > Hi,
>> >
>> > I'm fairly new at VBA programming. I have run into a snag.
>> >
>> > I want to use code to save edited data from unbound text boxes. The
>> > following code fragment causes an error when I try to compile the
>> > module.
>> >
>> > Error:
>> > "Compile Error, Method or data member not found"
>> >
>> > Code:
>> > With SdrInfo
>> > '
>> > .Edit <----------- Debugger highlights this line
>> > .
>> > .
>> > .
>> > .Update
>> > With End
>> >
>> > I have used this code before with success, but now it won't
>> > compile and I am not sure why. Can anyone help me with this?
>> >
>> > Thanks in advance.

>>
>>



 
Reply With Quote
 
Brendan Reynolds
Guest
Posts: n/a
 
      14th Apr 2006
The OpenRecordset method of the DAO Database object will always return a DAO
Recordset, so if SdrInfo was anything other than a DAO Recordset, I'd expect
a Type Mismatch error on the line that calls OpenRecordset. I think you may
need to post more of the code before we can see what the problem is.

--
Brendan Reynolds
Access MVP


"CityGuy" <(E-Mail Removed)> wrote in message
news:9DA19ACB-AC75-4939-A5CE-(E-Mail Removed)...
> Hi,
>
> Thanks for the tip. How does one know if a database is an ADO or DAO.
> I still find the differeneces between these 2 confusing.
>
>
>
> "Alex Dybenko" wrote:
>
>> Hi,
>> if SdrInfo - is ADO recordset - then you don't need to call edit method,
>> just comment this line out
>>
>> --
>> Best regards,
>> ___________
>> Alex Dybenko (MVP)
>> http://alexdyb.blogspot.com
>> http://www.PointLtd.com
>>
>>
>> "CityGuy" <(E-Mail Removed)> wrote in message
>> news:BFEA0D76-FA8E-4A66-9271-(E-Mail Removed)...
>> > Hi,
>> >
>> > I'm fairly new at VBA programming. I have run into a snag.
>> >
>> > I want to use code to save edited data from unbound text boxes. The
>> > following code fragment causes an error when I try to compile the
>> > module.
>> >
>> > Error:
>> > "Compile Error, Method or data member not found"
>> >
>> > Code:
>> > With SdrInfo
>> > '
>> > .Edit <----------- Debugger highlights this line
>> > .
>> > .
>> > .
>> > .Update
>> > With End
>> >
>> > I have used this code before with success, but now it won't
>> > compile and I am not sure why. Can anyone help me with this?
>> >
>> > Thanks in advance.

>>
>>



 
Reply With Quote
 
Dirk Goldgar
Guest
Posts: n/a
 
      14th Apr 2006
"Brendan Reynolds" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)
> The OpenRecordset method of the DAO Database object will always
> return a DAO Recordset, so if SdrInfo was anything other than a DAO
> Recordset, I'd expect a Type Mismatch error on the line that calls
> OpenRecordset. I think you may need to post more of the code before
> we can see what the problem is.


I don't think the "type mismatch" error will be raised until run time.
The "method or data member not found" error will be raised at compile
time, which is what CityGuy is reporting.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


 
Reply With Quote
 
Brendan Reynolds
Guest
Posts: n/a
 
      14th Apr 2006
Yes, you're right Dirk, thanks.

--
Brendan Reynolds
Access MVP

"Dirk Goldgar" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "Brendan Reynolds" <(E-Mail Removed)> wrote in
> message news:(E-Mail Removed)
>> The OpenRecordset method of the DAO Database object will always
>> return a DAO Recordset, so if SdrInfo was anything other than a DAO
>> Recordset, I'd expect a Type Mismatch error on the line that calls
>> OpenRecordset. I think you may need to post more of the code before
>> we can see what the problem is.

>
> I don't think the "type mismatch" error will be raised until run time.
> The "method or data member not found" error will be raised at compile
> time, which is what CityGuy is reporting.
>
> --
> Dirk Goldgar, MS Access MVP
> www.datagnostics.com
>
> (please reply to the newsgroup)
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
edit while debug problem =?Utf-8?B?c3VqaXRo?= Microsoft ASP .NET 1 6th Mar 2007 09:35 AM
debug error on ".MoveFirst" statement =?Utf-8?B?Q2l0eUd1eQ==?= Microsoft Access 8 10th May 2006 02:42 AM
random Microsoft Visual C++ Debug Library Debug Error =?Utf-8?B?ZGNobWFu?= Microsoft Access VBA Modules 1 26th Apr 2006 03:25 PM
Visual C++ Debug Library. Debug Error! Abnormal program termination John Microsoft Outlook Discussion 1 25th Sep 2004 09:00 PM
Going nuts...a sql insert statement error...how to debug from here? Kathy Burke Microsoft ASP .NET 6 13th Aug 2003 03:24 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:39 PM.