Sign Up |  Live StatsLive Stats    Articles 37,471| Comments 178,717| Members 19,496, Newest harshith| Online 447
Home Contact
 (Forgotten?): 
    10 years of Excellence
    For best SPN experience, use Firefox Internet Browser!


                                                                   Your Banner Here!    




Click Here to Register/Sign Up Daily Hukamnama Member Blogs Downloads Website Navigation Help Fonts Tags
Sikh Philosophy Network » Sikh Philosophy Network » Current News » Information Technology » Error 2448 ("You can't assign a value to this object") cause?

Error 2448 ("You can't assign a value to this object") cause?

Our Donation Goal : Why Donate? : Donate Today! : Donate Anonymously (ਗੁਪਤ) : Our Family of Supporters
Goal this month: 500 USD, Received: 0 USD (0%)
Please Donate...
     
Related Topics...
Thread Thread Starter Forum Replies Last Post
VBA Access - Moving parts of a program to DLLs? Error 91.. "Object variable or With block variable not set" axs221 Information Technology 10 28-Jul-2006 08:41 AM
" Invalid Argument" error (# 3001) - Conversion Access 97 to 2002 fred_y_Ohio Information Technology 2 28-Jul-2006 08:27 AM
RE: Add "Object in this database" to Insert Hyperlink dialog box k2 Information Technology 1 28-Jul-2006 08:07 AM
RE: Add "Object in this database" to Insert Hyperlink dialog box BobJL Information Technology 2 28-Jul-2006 08:04 AM
".wav" OLE object class name mkhmer Information Technology 1 28-Jul-2006 08:01 AM


Tags
2448, assign, cause, error, objectquot, quotyou, value, you cant assign a value to this object
Reply Post New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!
  #1 (permalink)  
Old 28-Jul-2006, 08:08 AM
Andrew R's Avatar Andrew R
Guest
 
Posts: n/a
   
   
Error 2448 ("You can't assign a value to this object") cause?

  Donate Today!   Email to Friend  Tell a Friend   Show Printable Version  Print   Contact sikhphilosophy.net Administraion for any Suggestions, Ideas, Feedback.  Feedback  

Register to Remove Advertisements
Hi

I have the following sub in an Access database, the idea of which is to
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/9887-error-2448-you-cant-assign-value.html
clear all controls on a passed form. But when I run it, I get the error
message "You can't assign a value to this object" at the very first
text box it hits! I assign a value to the text box (from a recordset)
at the load event without problem, so I'm a bit stumped...

Any thoughts?

Andrew



Public Sub ClearForm(frmClearedForm As Form)
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9887
Dim ctl As Control
'Cycle through the controls
For Each ctl In frmClearedForm

'Test if they are textboxes, listboxes etc
If TypeOf ctl Is TextBox Then ctl = "a"
If TypeOf ctl Is ComboBox Or TypeOf ctl Is ListBox Then
ctl.ListIndex = 0
If TypeOf ctl Is CheckBox Then ctl.Value = False
If TypeOf ctl Is OptionButton Then ctl.Value = False
Next ctl
End Sub



Do you agree or disagree with the writer above? Why not share your immediate thoughts with us! Login Now! or Sign Up Today! to share your views... Gurfateh!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 28-Jul-2006, 08:08 AM
Douglas J Steele's Avatar Douglas J Steele
Guest
 
Posts: n/a
   
   
Re: Error 2448 ("You can't assign a value to this object") cause?

See whether

If TypeOf ctl Is TextBox Then ctl.Text = "a"

works any better.

--
Doug Steele, Microsoft Access MVP
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9887
http://I.Am/DougSteele
(no e-mails, please!)


"Andrew R" wrote in message
news:1147962982.840567.3000@j55g2000cwa.googlegrou ps.com...
> Hi
>
> I have the following sub in an Access database, the idea of which is to
> clear all controls on a passed form. But when I run it, I get the error
> message "You can't assign a value to this object" at the very first
> text box it hits! I assign a value to the text box (from a recordset)
> at the load event without problem, so I'm a bit stumped...
>
> Any thoughts?
>
> Andrew
>
>
>
> Public Sub ClearForm(frmClearedForm As Form)
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9887
> Dim ctl As Control
> 'Cycle through the controls
> For Each ctl In frmClearedForm
>
> 'Test if they are textboxes, listboxes etc
> If TypeOf ctl Is TextBox Then ctl = "a"
> If TypeOf ctl Is ComboBox Or TypeOf ctl Is ListBox Then
> ctl.ListIndex = 0
> If TypeOf ctl Is CheckBox Then ctl.Value = False
> If TypeOf ctl Is OptionButton Then ctl.Value = False
> Next ctl
> End Sub
>



Reply With Quote
  #3 (permalink)  
Old 28-Jul-2006, 08:08 AM
Andrew R's Avatar Andrew R
Guest
 
Posts: n/a
   
   
Re: Error 2448 ("You can't assign a value to this object") cause?

Thanks for the suggestion, but not really working. The reason I didn't
use the .text property is that if you do, you get the error message
"Error 2185: You can't reference a property or method for a control
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9887
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9887
unless the control has focus".

I could use the .setfocus method for each control, but that seems very
clunky, and I don't see why the original solution fails.

Incidentally, I should perhaps explain that setting the value to "a"
was not the original idea - it was originally ctl="" to clear it out! I
changed it to ="a" to see if a more visible result would help matters!!

Thanks
Andrew

Reply With Quote
  #4 (permalink)  
Old 28-Jul-2006, 08:08 AM
Andrew R's Avatar Andrew R
Guest
 
Posts: n/a
   
   
Re: Error 2448 ("You can't assign a value to this object") cause?

  Donate Today!  
Hello again!

I managed to sort it out, so just wanted to mention the solution in
case it helps anyone else out.

The problem was that a couple of the text boxes on the form were not
unbound - their control sources were set to calculations of length of
service as a customer etc. This meant that I was not able to change
their value, resulting in the error described above.

The solution (or at least my solution) was as below

Thanks again for your help

Andrew

Public Sub ClearForm(frmClearedForm As Form)
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9887
Dim ctl As Control

'Cycle through the controls
For Each ctl In frmClearedForm
'Test if they are textboxes, listboxes etc
If TypeOf ctl Is TextBox Then
'Check if it's unbound
If ctl.ControlSource = "" Then
ctl = ""
End If
End If
If TypeOf ctl Is ComboBox Or TypeOf ctl Is ListBox Then
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9887
ctl.ListIndex = 0
If TypeOf ctl Is CheckBox Then ctl.Value = False
If TypeOf ctl Is OptionButton Then ctl.Value = False
Next ctl
End Sub

Reply With Quote
   Click Here to Donate Now!

Support Us!
Become a Promoter!
Gurfateh ji, you can become a SPN Promoter by Donating as little as $10 each month. With limited resources & high operational costs, your donations make it possible for us to deliver a quality website and spread the teachings of the Sri Guru Granth Sahib Ji, to serve & uplift humanity. Every contribution counts. Donate Generously. Gurfateh!
ReplyPost New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!

Bookmarks


(View-All Members who have read this thread : 0
There are no names to display.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Tools Search
Search:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

» Active Discussions
Can Sikhs worship...
Today 17:14 PM
41 Replies, 458 Views
Amrit sanchar...
By Ishna
Today 17:09 PM
0 Replies, 1 Views
Would an Atheist Pray in...
Today 13:57 PM
63 Replies, 5,333 Views
Nice Punjabi Songs with...
Today 08:50 AM
19 Replies, 537 Views
Sikh Philosophy Network...
Today 04:13 AM
18 Replies, 859 Views
Rozana Reports (ਪੰਜਾਬੀ...
Today 03:39 AM
410 Replies, 9,476 Views
Thought of the Moment!
Today 00:06 AM
116 Replies, 6,145 Views
English Sri Guru Granth Sahib Ji Translations
Yesterday 23:30 PM
6 Replies, 122 Views
Sikh Spokesman (ਪੰਜਾਬੀ...
Yesterday 21:25 PM
256 Replies, 6,087 Views
Difference in Bowing...
By Kamala
Yesterday 15:08 PM
11 Replies, 286 Views
What Really Happened on...
Yesterday 12:46 PM
13 Replies, 268 Views
Free Online Gurbani...
Yesterday 03:56 AM
13 Replies, 4,353 Views
English Sri Guru Granth...
Yesterday 03:51 AM
5 Replies, 190 Views
Edward Snowden: the...
Yesterday 03:34 AM
3 Replies, 205 Views
What Is Difference...
18-Jun-2013 09:18 AM
6 Replies, 185 Views
» Books You Should Read...
Powered by vBadvanced CMPS v3.2.3
All times are GMT +6.5. The time now is 17:23 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2 Copyright © 2004-12, All Rights Reserved. Sikh Philosophy Network


Page generated in 0.43267 seconds with 32 queries