Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

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 October 7th, 2003, 06:49 AM
Snowsride Snowsride is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 79 Snowsride User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 27 m 53 sec
Reputation Power: 6
Can't assign value

I have form with several text boxes that are populated by a procedure called from a combo box from which the user makes a selection.

I want to create a Cancel button to undo any unsaved changes to the text boxes so I have copied the following code from the Access Help file but get 'error 2448. Can't assign value to this object.'

Sub btnUndo_Click()

Dim ctlC As Control
' For each control.
For Each ctlC In Me.Controls
If ctlC.ControlType = acTextBox Then
' Restore Old Value.
ctlC.Value = ctlC.OldValue
End If
Next ctlC

End Sub

Any ideas?

Reply With Quote
  #2  
Old October 8th, 2003, 07:41 AM
m_lazor m_lazor is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Luxembourg
Posts: 156 m_lazor User rank is Corporal (100 - 500 Reputation Level)m_lazor User rank is Corporal (100 - 500 Reputation Level)m_lazor User rank is Corporal (100 - 500 Reputation Level)m_lazor User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
You try to set "Value". Try to set .Text instead. Also do not try to set values in calculated fields. They will refuse that with a similar error message.
When you have calculated fields and others that store values in the database it may be better to use a particular name prefix in order to distinguish them (dbf = db field). acTextBox will not be sufficient as a criterion and you would then use:

If Left(ctlC.name, 3) = "dbf" Then

Reply With Quote
  #3  
Old October 8th, 2003, 02:02 PM
Snowsride Snowsride is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 79 Snowsride User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 27 m 53 sec
Reputation Power: 6
Thanks

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Can't assign value


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 1 hosted by Hostway
Stay green...Green IT