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:
  #1  
Old July 16th, 2004, 06:43 AM
Paula Paula is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 65 Paula User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 37 m 32 sec
Reputation Power: 5
Referencing a form from VBA

Hi,

I'm sure this is really simple but I'm new to this.

I want to multiply the values of two fields, one on the form that I'm coding behind, and another from a separate form. I keep getting an error which says that it can't find the other form. It's there, so I presume my code to reference it is wrong. Any ideas of how I should be doing this?

If IsNull([Grade]) = False Then
Me![Cost] = (Me![Hours Spent]) * (Forms![Lookup StaffRates]![HourlyRate])
End If

Reply With Quote
  #2  
Old July 16th, 2004, 10:22 AM
KevinRedfern KevinRedfern is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 7 KevinRedfern User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
if the Lookup StaffRates is not open then it will have nothing to look up.

I am assuming you have some ID field relating it back to the form you are running this calculation on.

in the form properties!record source. Link the other table to the open you are using. Because they are linked you should not have to look for another form.

So it shuld read:-

If IsNull([Grade]) = False Then
Me![Cost] = (Me![Hours Spent]) * (Me![HourlyRate])
End If
hope this helps

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Referencing a form from VBA


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 | 
  
 





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