Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old June 19th, 2004, 12:02 PM
Nick Lauer Nick Lauer is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 3 Nick Lauer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Angry problems running copied vba code

I copied all the objects from one db to another. in the new db i get a compile error in my vba code. this is strange since it runs fine in the original db on the same machine. it is almost as if by copying over the objects (using "get external data", "import") i am not copying over some stuff necessary to make vba run properly (hidden tables?)

the message is "Compile error: method or data member not found". It points to the text in red below.

Private Sub Form_Close()
Dim myform As Recordset
Set myform = Me.RecordsetClone
Dim tran As Recordset, mydb As Database
Set mydb = DBEngine.Workspaces(0).Databases(0)
Set tran = mydb.OpenRecordset("tblMemberTransactions", dbOpenTable)
myform.MoveFirst
If myform.GiftAmt <> 0 And Not IsNull(myform.GiftAmt) Then
tran.AddNew
tran.GiftAmt = myform.GiftAmt
tran.MemberID = MemID

GiftAmt appears to be a valid data (currency) box in the subform, and in the tblMemberTransactions.

I get similar errors in some other vba behind forms as well.

Any ideas??

Reply With Quote
  #2  
Old June 19th, 2004, 12:19 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 18 h 33 m 48 sec
Reputation Power: 180
The error indicates there is no GiftAmt control or variable on your form.
__________________
======
Doug G
======
I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain

Reply With Quote
  #3  
Old June 19th, 2004, 03:15 PM
Nick Lauer Nick Lauer is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 3 Nick Lauer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
copied vba code

any idea why and exact copy would have these kinds of problems? ever see this before?

Reply With Quote
  #4  
Old June 19th, 2004, 03:18 PM
Nick Lauer Nick Lauer is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 3 Nick Lauer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
problems with copied vba code

any idea why and exact copy would have these kinds of problems? ever see this before?

Reply With Quote
  #5  
Old June 19th, 2004, 10:32 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 18 h 33 m 48 sec
Reputation Power: 180
Why don't you use the debugger and step through your code. You should be able to easily find the missing object(s).

Sounds like your copy didn't copy everything, or the missing control isn't available on the target machine, or your versions of Access are different.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > problems running copied vba code


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway