Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 5th, 2004, 03:12 AM
Authorized User
 
Join Date: Aug 2003
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default caption

I' have a statement in VB that look like this :-

lblExtendedPrice.Caption = curExtendedPrice

when i compile, the error message below appear :-

Method or data member not found

I'm totally new on using this VB...can anybody help me on this matter.

 
Old April 5th, 2004, 03:27 AM
Authorized User
 
Join Date: Aug 2003
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

sorry...it look like this

lblExtendedPrice.Caption = FormatCurrency(curExtendedPrice)

 
Old April 5th, 2004, 10:48 PM
Authorized User
 
Join Date: Feb 2004
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try to isolate the problem. Hit Ctrl-G to see the debug window, immediate pane. Then type:

?formatcurrency(5)

and hit the enter key. If you get an error message, Access is not seeing the function 'FormatCurrency'. In that case, you need to check your references from a module window, Tools menu - References. Look to see if any are marked missing and if so, clear the check box for the missing ones and try again.

If you get a currency formatted value, the problem is likely on the other side of your equal sign. It is good practice to reference controls by preceding them with a reference to the form on which they are contained. It looks like the control is on the current form so in the code window where this procedure is located, type

Me.

When you hit the period, you should see a list of control names found on the current form. Typing lblext...
will fetch the control names beginning with those characters. When the correct one is listed, hit the tab key and it will AutoComplete (if this feature is enabled from the menu Tools-Options... Provided you check that the control with this name is actually a label, this will guarantee the correctness of that side of the equal sign. If the control is not a label (or another control with a caption property, you will get the same error message. If the control is on a different form, that form has to be open and you need to have the name of the form 'dot' name of control.

One more point. If curExtendedPrice happens to be of variant type and contains a null or a string, the code will raise a different error.

Ciao
Jürgen Welz
Edmonton AB Canada
[email protected]





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Black a Caption Bar? jrahma C# 1 October 26th, 2008 07:40 AM
Checkbox Caption brian189 Access VBA 3 May 25th, 2007 07:05 AM
Change Caption HtmlInputFile Israr ASP.NET 1.0 and 1.1 Professional 4 November 8th, 2006 02:32 AM
Caption Field Brendan Bartley Access 2 June 2nd, 2006 07:24 AM
ToolWindow Caption Kep C# 0 February 24th, 2004 12:59 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.