Form mysteriously stops accepting VB changes to values in text boxes????

Hello Everyone,
Something mysterious has happened to my form:
I had code to the following effect being executed as part of Form_Open: 

With Me
   ...
   ...
   .txtDIC.Value = intEDays
   ...
   ...
End With

Where .txtDIC is a bound text box control. Everything was fine until recently,
when I started getting the error message:

****************
Run-time error '2448'
You can't assign a value to this object
****************

I replaced it with...

strSQL = "UPDATE tblCustOrds SET DaysInCell = " & intEDays & " WHERE ID = " &
..OpenArgs
   CurrentDb().Execute strSQL, dbFailOnError

....Which seems to work but the thing that bothers me is that the simpler method
of changing the table values worked before but now raises an error so something
has changed but I don't know what. Any ideas?
Thank You,
-plh


-- 
Where are we going and why am I in this HAND BASKET??
0
plh
7/11/2007 7:24:58 PM
access.formscoding 7493 articles. 0 followers. Follow

1 Replies
493 Views

Similar Articles

[PageSpeed] 17

"plh" <plh_member@newsguy.com> wrote in message 
news:f73aqa02bvp@drn.newsguy.com...
> Hello Everyone,
> Something mysterious has happened to my form:
> I had code to the following effect being executed as part of Form_Open:
>
> With Me
>   ...
>   ...
>   .txtDIC.Value = intEDays
>   ...
>   ...
> End With
>
> Where .txtDIC is a bound text box control. Everything was fine until 
> recently,
> when I started getting the error message:
>
> ****************
> Run-time error '2448'
> You can't assign a value to this object
> ****************
>
> I replaced it with...
>
> strSQL = "UPDATE tblCustOrds SET DaysInCell = " & intEDays & " WHERE ID = 
> " &
> .OpenArgs
>   CurrentDb().Execute strSQL, dbFailOnError
>
> ...Which seems to work but the thing that bothers me is that the simpler 
> method
> of changing the table values worked before but now raises an error so 
> something
> has changed but I don't know what. Any ideas?
> Thank You,
> -plh
>
>
> -- 
> Where are we going and why am I in this HAND BASKET??

I don't know why it suddenly stopped working, but I'm surprised that it 
worked at all. You can't reliably work with record source values in the Open 
event of the form, because the record source hasn't necessarily been loaded. 
That's what the Load event is for. Try putting your code in the Load event 
and see if it works.

Carl Rapson


0
Carl
7/11/2007 10:07:00 PM
Reply:

Similar Artilces:

Problem adding new record in form view
Hi there, I have inherited an acccess database and have had to do some troubleshooting on an error message which is now sorted out. I now am unable to add a new record in form view, however if I enter the information directly into the table there is no problem. Please could you help with what might be going wrong? Thanks -- Snoozi Suzi Open the form in design view. Open the properties window for the form. Is the Allow Additions property set to yes? Regards Jeff Boyce Microsoft Office/Access MVP "SnooziSuzi" <SnooziSuzi@discussions.microsoft.com> wrote in message n...

Order entity
The "Order" entity in CRM has a number of status's (Active, Fulfilled, Cancelled, Submitted and Invoiced). From the Actions menu on the Order form it's possible to Cancel and Fulfill an Active order - and doing so changes the Order status as you would expect. However: 1) Invoicing the order (which creates an Invoice record) doesn't change the status of the order to Invoiced 2) I can't see how to change the status to Submitted. I expect it's possible to do both of the above programatically. However is it possible to do it through the CRM UI? On Jun 14, 9:10=A...

Deleting characters in text fields
I have a table of data where the quantity is stored as a text value. Before I convert it to a number value I need to delete some of the characters. Most of the values appear like this: 25.000- but some appear as 5- with no decimal points. Is there a way to to strip out all characters to the left of the decimal point so that 25.000- ends up as 25? Or is there a way just to strip out the " - " character to get 25.000? Thanks, Sean Sean, You can strip out the "-" by using the Replace command: Replace("25.000-", "-", "") Taking every...

Exchange 2003 OWA stopped working and DNS Events
Hi All, I am struggling with yet another Exchange 2003 problem. It has been working flawlessley for almost, nothing changed and all of a sudden quit working. When I try to open up my OWA I am getting the 503 service unavailable page. In my Event Logs, I am seeing this when I reboot the server: The dynamic registration of the DNS record '_ldap._tcp.Default-First-Site-Name._sites.ForestDnsZones.ic-MYDOMAINXXXX.us. 600 IN SRV 0 100 389 exchange.MYDOMAINXXXX.us.' failed on the following DNS server: DNS server IP address: 205.178.190.31 Returned Response Code (RCODE): 5 Returne...

Highlighting Texts
can you highlight text in publisher the way you can in word Hi tom (anonymous@discussions.microsoft.com), in the newsgroups you posted: || can you highlight text in publisher the way you can in || word No Tom, you cannot. The work around involves creating a small rectangle, filling the rectangle with the desired highlight color and place behind the text. -- Brian Kvalheim Microsoft Publisher MVP http://www.publishermvps.com ~pay it forward~ This posting is provided "AS IS" with no warranties, and confers no rights. >-----Original Message----- >Hi tom (anonymous@disc...

Changing the fields the LOOK FOR facility uses
Hi, Ive had a good look round the system and dont think this is possible, just wondered if anybody else has any ideas. The issue is as follows :- If I go to the default cases view (All Cases), I can see all cases against all accounts. I would like to be able to Look For all or part of an account name (or potentially other fields) to quickly filter this list. Is it possible to alter or add the fields that the Look For facilty will use to return results? or Can an advanced find use take arguments? Cheers Dan Hi, Go to Settings - Customization, and customize the Case enti...

changing SMTP Port
I am working on securing my Exchange 5.5 server on the SMTP port level. I have a box in the DMZ that listens on port 25 and then sends on port 1025. My internal email firewall inside the core listens and sends on port 1025. I have modified the service file on the NT 4.0 server wher my Exchange 5.5 is installed to show SMPT port as being 1025. I rebooted the server and test. I can send email to the exchange server, it is listening on port 1025 but is only sending on port 25. Is there a way to configure the Exchange 5.5 server to listen and send on port 1025? Thanks for any help given. Ron. ...

Change Name in OWA
Hi all, I had a question about OWA with exchange 2007. Do users have the ability, through the GUI of OWA, to change their first and last names that are set in Active Directory? Robert no "supersonic_oasis" <supersonicoasis@discussions.microsoft.com> wrote in message news:01F36301-1428-482E-8E86-4BDC21EFFD04@microsoft.com... > Hi all, > > I had a question about OWA with exchange 2007. Do users have the ability, > through the GUI of OWA, to change their first and last names that are set > in > Active Directory? > > Robert ...

Sum based on range values
I need to sum a column A, but only if values in an adjacent column B>0. Therefore the example below should sum to 10 (only including the first 3 rows). A B 7 5 0 4 3 9 0 0 0 0 0 0 8 0 0 0 0 0 Ideally this should be a formula in a cell, not a macro. Any ideas? It doesn't sound complicated, but I can't get my head round it. TIA Ian Thanks Julie. I knew it had to be straightforward. Just a case of knowing which function to use. Ian "JulieD" <JulieD@hctsReMoVeThIs.net.au> wrote in message news:%23$anRGw$EHA.3836@tk2msftngp13.phx.gbl... > Hi > > us...

Formatting 0 values to show blank cells
I am using the =IF(ISNA(VLOOKUP(...)),0,VLOOKUP(...)) to return a zero value. For printing purposes I need the 0 to not show in the cell (blank cell). I can do this by using the accounting format, but a dash (-) still shows in the cell. The sheet is protected to protect the formula. How can I protect AND not show anything in the cell WHILE keeping the value at "0"? You can use set the custom format to ;;""; See Worksheet and Excel table basics > Formatting numbers in Excel help file for details. "RLD" wrote: > I am using the =...

What happened to the New Form Dialog box; are there still autoform
...

Change default "SaveAs" to *.msg rather than *.html
Hi!, I regularly need to save emails and prefer to save as *.msg so the attachments etc are contained within the one file. How can you change the default SaveAs command to Save as Type in a *.msg format (rather than *.html) so the type is already *.msg without having to use the pull down? Thank you Troy It would be nice to know what mail client you talk about :) "TroyB" <boeky72@hotmail.com> wrote in message news:420b0849$0$1496$5a62ac22@per-qv1-newsreader-01.iinet.net.au... > Hi!, > I regularly need to save emails and prefer to save as *.msg so the > attachme...

How to change a Macro based on content of a cell
Hi, I need to import a text file into a spreadsheet. I can do this manually by doing File > Open > then select a text file. Then Excel goes through the Text Import Wizard I can automate this by recording a Macro in Excel. The macro looks like this (Excell wrote that for me, I did not): Sub Macro1() Workbooks.OpenText Filename:="C:\DrillData\" + "MOR701.pck", Origin:=xlMSDOS, _ StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=Array(Array(0, 1), Array(12 _ , 1), Array(26, 1), Array(37, 1)), TrailingMinusNumbers:=True End Sub How can I change ...

Reset Tab Order on Template Contact Detail Form
I have edited the design of the Contacts Detail Template form. How do I reset the tab order to start with the new text boxes I have entered? In Design View I selected all of the text boxes, selected Tab Order, and for the template only "tabContacts appears for the Tab Order rather than the list of text boxes in the tab order. The new items I added are on the list, but in order to make the form work, I had to move them to the top of the form. When I return to form view, select Save and New, the tab goes to my new tab "Category1" then "Category2", then it goes to...

Changing Fold Position
Publisher appears to favour top over side fold (for landscape cards) - I'd like to make some side-fold cards, but I can't seem to change the position of the fold. Any way to do it? I've had a request for side fold cards, and I can't let the customer down! Side fold are also more stable when displayed - tent cards tend to collapse I've found, book fold are more stable because there's less weight (or something!) And you all should know what version I'm running by now! If you don't, I ain't gonna tell ya! You'll just have to look through my posts! <eg&g...

Tab order on form issue
<sigh> This is frustrating me. I'm sure the answer is simple, but I can't find it. Bear with me. I have a form with non-ActiveX fields in Word 2003. FieldA is a drop-down and based on the choice (with an OnExit macro), fields after FieldA become either enabled or disabled. Let's say I have text field FieldA_1A and dropdown FieldA_2A. Depending on my choice in FieldA, one or the other of those two are enabled. Both are disabled to start (you must choose something from FieldA to enable the appropriate field. My problem is that when I tab out, FieldB (which ...

Text Overflow into Different Row
Excel allow text to overflow into an adjacent cell as long as it is empty and it is in the same row. How can I make it overflow if it si in a different row? Thank you ...

no text on subform when there are no child records
Your help is appreciated. I'm relatively new to Access with no VBA training. My form calls GrantID and Grant# from tblGrant. The subform shows current records from a query of tblQuestion and tblQuestionDescription (tblGrant has a 1-to-many relationship with tblQuestion). When I created the subform, I chose to have the subform fields related to GrantID. The challenge...if a Grant# doesn't currently have any related records on tblQuestion, the labels and fields on the subform do not show - the subform is blank. I want the user to be able to add records to the subform that populate tblQ...

Deleting Rows Automatically using a Text File List
I have a text file list of .jpg files that I want to delete (rows) from Excel. The list has 800+ items in it. Deleting these rows one at a time in Excel (after doing a "find") is terribly time consuming. Does anyone know how to make Excel read my text file and delete the rows with that filename in it (automatically). The filename (listed in the text file) is in a column (in my excel sheet) called "filename". Any help would be most appreciated!!! Seriously! I may have to spend hours on this otherwise! Thank you, Arielle -- mirdonamy ------------------------------...

VALUE error message
I would like I5 to equal F5+G5-h5. I get a value error message. one or more of the cells F5,G5 or H5 probably have text in them, either a number entered/pasted as text, or a "blank" made by pressing the space bar (and inserting a space character). For the first problem, copy an empty cell, select F5:H5 and choose Edit/Paste Special, selecting the Values and Add radio buttons, then click OK. This will coerce any "text" numbers to real numbers. For the latter, use the del key or Edit/Clear/Contents rather than the spacebar to clear the cell. Note that SUM(F5:G5,-H5...

open dialogue box
Can I print the Open dialogue box? I want to take a picture of all the listed documents in each Word folder to show the date and time they were created. Thank you. D. Ring You can take a screen shot, and insert it as an image into a Word file. Assuming you're using Windows with no other software hijacking the PrintScreen key, display the Open dialog box with the information you need, and press Alt+PrintScreen. This sends a copy of the current window to the clipboard. Then click in a blank Word document, and press Ctrl+V to paste the image into the Word docume...

1099 form
Anyone knowwhere I can find a 1099 tax form template in either Excel or Word? try here http://www.help.net/irs_1000-1999.html "Joe" <jhneely@bellsouth.net> wrote in message news:01c301c3926b$43dd5300$a101280a@phx.gbl... > Anyone knowwhere I can find a 1099 tax form template in > either Excel or Word? http://home.mchsi.com/~taxcalculator/ HTH Paul -------------------------------------------------------------------------------------------------------------- Be advised to back up your WorkBook before attempting to make changes. -----------------------------------------...

Keekp track changes
I have excel with 100 records which will be update my another person. I would like to keep what have been change for that 100 record, any tools to track or how to do it ? You can use a macro that will automatically insert a comment in a cell giving the date and time whenever the cell is changed: Install the following event macro in the worksheet code area: Private Sub Worksheet_Change(ByVal Target As Range) Dim r As Range Set r = Target r.NoteText Now End Sub -- Gary''s Student - gsnu200838 "DD" wrote: > I have excel with 100 records which will be update my anothe...

How to format number with mixed number and text?
I put the following formula into a cell: =6.65+0.15&" lb". It did what I intended, namely: add the numbers and display the result with the tag, i.e. "6.8 lb". However, the Number format seems to have no effect on the displayed result. For example, if Decimal Places is 2, the above result is still "6.8 lb", not "6.80 lb". I get more decimal places only if they are "needed". For example, =6.65+0.1511&" lb" displays 4 decimal places, even if the Number format is 2 decimal places. How can I control the format of the numeric ...

class wizard belives group box is a button
I use MS Visual C++, Version 6.0. Since I tried to use a component one number control (ActiveX) in my project, which brought the whole Studio 6.0 to crash, i see a strange behaviour. Whenever I drag and drop a group box control from the controls toolbar onto a dialog resource and then try to define a control variable with ClassWizard, it is handled as a button control. How can I re-teach my MSVC++ that the group box is a static, not a button? Any help would be appreciated. How do i get rid of the component one control icon in the control toolbar? Where is the definition file of the stan...