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 November 20th, 2007, 05:02 PM
Registered User
 
Join Date: Nov 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default field.value

I have a report with an unbound text field on it and I'm just trying to pass a string to it like this:

me.myfield.value = "myText"

When I try to do this I get the 'You can't assign a value to this object' error. I'm using access 2007.

Anyone have any ideas?

 
Old November 21st, 2007, 01:09 PM
Authorized User
 
Join Date: Oct 2003
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If I recall this situation correctly, in the event that you have
this code in the Report_Open() event, you may want to try moving
it into the Report_Activate() event.

Do you have it in an event other that Report_Open()?
 
Old November 21st, 2007, 05:32 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Where is the textbox on your report? I've had a similar problem before and I had the textbox under the page footer instead of the report footer. It makes all the difference in the world.

 
Old November 26th, 2007, 09:18 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Also, try this with text boxes:

me.myfield = "myText"

.Value is not needed when posting to a text box, only when retrieving values, sometimes.



mmcdonal

Look it up at: http://wrox.books24x7.com
 
Old November 26th, 2007, 05:44 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Welcome to P2P.

Another situation is that the textbox is unbound with a value ALREADY set in its control source. If you try to set a value to it via VBA code as well, you will get that error.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division





Similar Threads
Thread Thread Starter Forum Replies Last Post
Replace Gridview field if null with new field Indo77 ASP.NET 2.0 Basics 1 June 18th, 2007 06:22 AM
Fill field based on another field skwilliams Classic ASP Basics 3 December 30th, 2006 11:02 AM
Updating a Date field based on another field arholly Access VBA 6 November 22nd, 2006 11:19 AM
Copy previous field record if next field is null ecampos Access VBA 6 June 23rd, 2006 12:55 PM
Update city field based on zip field nganb SQL Server ASP 0 April 22nd, 2004 10:30 PM





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