473,587 Members | 2,489 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

You can't assign a value to this object Error!

129 New Member
Hi i have created a Sales Order Header with a Sales Order Line (1 to many relationship) See Picture for image of error! I receive this error when inputting data into the sfrmSOHeader in Add mode. I get this error then i can input data like normal. I dont know why i receive this error but i must get rid of it. The control is not read only, or design-view and definately not too large.

Here is the sfrmSOHeader On Current Code;

Expand|Select|Wrap|Line Numbers
  1.     Dim ParentDocName As String
  2.  
  3.     On Error Resume Next
  4.     ParentDocName = Me.Parent.Name
  5.  
  6.     If err <> 0 Then
  7.         GoTo Form_Current_Exit
  8.     Else
  9.         On Error GoTo Form_Current_Err
  10.         Me.Parent![sfrmSOLine].Requery
  11.     End If
  12.  
  13.     DoCmd.SetWarnings False
  14.  
  15.     If Me.OrderStatus.Value = -1 Then
  16.         Me.Form.AllowAdditions = False
  17.         Me.Form.AllowDeletions = False
  18.         Me.Form.AllowEdits = False
  19.         Me.cmdDeleteHeader.Enabled = False
  20.         Me.cmdProcessHeader.Enabled = False
  21.         Me.cmdSave.Enabled = False
  22.         [Forms]![frmCustomerOrderForm]![cmdImportCSVFile].Enabled = False
  23.         [Forms]![frmCustomerOrderForm]![cmdAddNewItem].Enabled = False
  24.         [Forms]![frmCustomerOrderForm]![sfrmSOLine].Form.AllowAdditions = False
  25.         [Forms]![frmCustomerOrderForm]![sfrmSOLine].Form.AllowDeletions = False
  26.         [Forms]![frmCustomerOrderForm]![sfrmSOLine].Form.AllowEdits = False
  27.         [Forms]![frmCustomerOrderForm]![sfrmSOLine]![cmdDeleteRec].Enabled = False
  28.     Else
  29.         Me.Form.AllowAdditions = True
  30.         Me.Form.AllowDeletions = True
  31.         Me.Form.AllowEdits = True
  32.         Me.cmdDeleteHeader.Enabled = True
  33.         Me.cmdProcessHeader.Enabled = True
  34.         Me.cmdSave.Enabled = True
  35.         [Forms]![frmCustomerOrderForm]![cmdImportCSVFile].Enabled = True
  36.         [Forms]![frmCustomerOrderForm]![cmdAddNewItem].Enabled = True
  37.         [Forms]![frmCustomerOrderForm]![sfrmSOLine].Form.AllowAdditions = True
  38.         [Forms]![frmCustomerOrderForm]![sfrmSOLine].Form.AllowDeletions = True
  39.         [Forms]![frmCustomerOrderForm]![sfrmSOLine].Form.AllowEdits = True
  40.         [Forms]![frmCustomerOrderForm]![sfrmSOLine]![cmdDeleteRec].Enabled = True
  41.     End If
And this is the cmdNewOrderNo Button On Click Code;

Expand|Select|Wrap|Line Numbers
  1.     'Sets the sfrmSOHeader.AllowDetails to True and the Visibility of Fields to True / False
  2.     'Sets sfrmSOHeader to move to NewRecord
  3.     Me.sfrmSOHeader.Form.AllowAdditions = True
  4.     Me.sfrmSOHeader.Form.AllowDeletions = True
  5.     Me.sfrmSOHeader.Form.AllowEdits = True
  6.     [Forms]![frmCustomerOrderForm]![sfrmSOHeader].Visible = True
  7.     [Forms]![frmCustomerOrderForm]![sfrmSOLine].Visible = False
  8.     keybox.Visible = False
  9.     lblOrderLine.Visible = False
  10.     cmdImportCSVFile.Visible = False
  11.     cmdAddNewItem.Visible = False
  12.     cmdGeneratePOrders.Visible = False
  13.     cmdOrderMaintenance.Visible = False
  14.     DoCmd.GoToControl "sfrmSOHeader"
  15.     DoCmd.GoToRecord , , acNewRec
  16.     [Forms]![frmCustomerOrderForm]![sfrmSOHeader]![OrderDate].SetFocus
  17.     'Reset the List lstCustOrderNo Field
  18.     Me.lstCustOrderNo.Value = ""
The reason for all the AllowAdditions, Edits and Deletions is because one of my requirements is to lock down the Orders when completed. If anyone can suggest how or why i receive this error it would be greatly appreciated!

p.s. The is more like a nuisance than an actual error but have trie many times to get rid but feel the problem maybe due to the allowadditions, deletions and edits code.
Attached Images
File Type: bmp Error.bmp (13.0 KB, 187 views)
Oct 31 '08 #1
2 2572
ADezii
8,834 Recognized Expert Expert
For starters, set a Breakpoint in Line #4 in the Current() Event of the Sub-Form, then Single Step (F8) thought he code, Repeat this process in the Click() Event, if the Error is happening there. This will pinpoint the Line on which the Error occurs. If you do not know how to set a Breakpoint, let me know.
Nov 1 '08 #2
Constantine AI
129 New Member
Hi i have managed to find the problem, it is to do with my Master and Child Links but haven't managed to fix it yet.

The Main Form consists of Three Entities; 1 Main Form and 2 Sub-Forms, all which are linked. The Names of the Entities are frmCustomerOrde rForm, sfrmSOHeader and sfrmSOLine.

The Master and Child Link from CustomerOrderFo rm to sfrmSOHeader is 'CustNo' Key Field. The Master and Child Link from sfrmSOHeader to sfrmSOLine is 'OrderNo' Key Field.

I have changed the Links to what they should be and its works fine thanks. Origanlly the Links had two references from the CustomerOrderFo rm to the sfrmSOHeader. I had 'CustNo' and 'OrderNo' Fields set as the Master and Child Links. Taking off the OrderNo reference link made it work fine now. Thanks again!
Nov 3 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

26
45491
by: Dave Hammond | last post by:
In document "A.html" I have defined a function and within the document body have included an IFRAME element who's source is document "B.html". In document "B.html" I am trying to call the function defined in "A.html", but every attempt results in an "is not a function" error. I have tried to invoke the function using...
1
13011
by: Jonathan | last post by:
I am getting an error message that other people have gotten. I have done some search and reading enough to see that this error isn't only happening to me. However, I am not able to discern a solution from what I have read. I am still a bit new to Access. I am using Access 2000. Here is the situation. I open up my database, go to Forms,...
33
3143
by: baumann.Pan | last post by:
hi all, i want to get the address of buf, which defined as char buf = "abcde"; so can call strsep(address of buf, pointer to token);
0
1093
by: Tim::.. | last post by:
HELP... Can someone please tell me why I keep getting the following error! I am new to AD is ASP.NET and would really appritiate any advice! Thanks ...ERROR.. Exception Details: System.Runtime.InteropServices.COMException: The specified domain either does not exist or could not be contacted
8
7392
by: Sergei | last post by:
Hi, I am displaying modal dialog and passing values from the main form to the modal dialog and back. It works fine but if I used the following syntax on Page_Load(just for testing) in VB to assign value form the object to text Box it gives error 'Object required' Dim strResponse As String strResponse = strResponse & "<script...
5
1905
by: Just Me | last post by:
Given a button name Btn_5 and Index=5 I want to do something like dim zz as string = Btn_??Index??.Text or given an array of buttons, do:
12
2029
by: dennist685 | last post by:
Can't edit, delete or add row in an Access database in a website 2003 When I implement a walkthrough using Northwind I have no trouble doing this. Also, in a windowsforms project I have no problem editing, adding or deleting rows. But in webforms the smarttags don't offer the options. Can anybody help?
1
2335
by: annbb | last post by:
I have a piece of code which resets all the control on a form ..but if I also put an option group on the form and the relevant code in the routine to reset it I get an error message saying that you cant assign a value to this object when the code reaches the line for the checkbox. The code works perfectly if EITHER option group or checkbox...
37
3920
by: jht5945 | last post by:
For example I wrote a function: function Func() { // do something } we can call it like: var obj = new Func(); // call it as a constructor or var result = Func(); // call it as a function
28
2164
by: Stef Mientki | last post by:
hello, I'm trying to build a simple functional simulator for JAL (a Pascal-like language for PICs). My first action is to translate the JAL code into Python code. The reason for this approach is that it simplifies the simulator very much. In this translation I want to keep the JAL-syntax as much as possible intact, so anyone who can read...
0
8216
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8349
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7974
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8221
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5719
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5395
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2364
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1455
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1192
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.