473,836 Members | 2,179 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I can't add new record on a form

6 New Member
I can't add new record on a form, the add new record in navigation toolbar is disable on the form, but on properties I enable (addition,edit and delete)but still it's not working.

Please assist
Aug 8 '13 #1
11 32087
Seth Schrock
2,965 Recognized Expert Specialist
That means that the recordsource for the form can't be modified. From my experience (although limited) this normally happens when the recordsource is a query, but I believe it can also happen with a table. If the recordsource is a query, then read this link to see why it won't let you modify the data: When can i update data from a query If you need help knowing where your query fits in the list, just post the SQL code for the query (making sure to use code tags. Read Before posting VBA/SQL code) and we can help you know what the problem is.
Aug 8 '13 #2
1,278 Recognized Expert Top Contributor
If the record source is a table it's likely there is no key defined.
Aug 8 '13 #3
6 New Member

I have added an attachment to my problem so it will be easy to pin point what i have missed, i hope it will help
Attached Files
File Type: zip Hombre.zip (1.88 MB, 634 views)
Aug 15 '13 #4
1,278 Recognized Expert Top Contributor
First, in your relationships (not in this form or query, in pull down menu Tools/Relationships) you have two tables appearing with no relationships at all defined. That can't be helpful, but maybe it causes no harm.

Your recordset is update-able but I was unsuccessful adding a record in datasheet mode because I don't know the data well enough. I keep getting key conflicts, but the point is the recordset itself is okay.

I think what you want to do is to change this 1 form into a form-subform design. Make a form that edits structure records only, and make it a subform of a form that edits Establishment records only. Or, you could disable the navigation buttons and create your own "add" button to this form. Then you could manage exactly what is supposed to happen when you click "add."

Right now, if you add a record it's not really clear what you want to happen. Add a structure record only? Or an Establishment and a Structure record? Work that out with form/subforms or manual VBA in the code-behind.

Aug 15 '13 #5
6 New Member
I want user's to add information within the form not manually on each table in datasheet view, this form is based on query with that combine 3 tables Establishment,D esignation and Structure table.

Firstly Post_id,Post_id Level,postgrade devired from Establishment, designation to Designation table and Cluster_Name,Un it_Name, Department_Name , Branch_Name, Division_Name,S ection_Name and Subsection_Name into the Structure table. That's the only information that the user I want to add

I hope this will help.
Aug 15 '13 #6
5,501 Recognized Expert Moderator Expert
Please provide the actual SQL that is being used for the form's record source.
As you have it listed (and in VERY difficult way) it appears to be something in the joins.
(no, I have not d/l your attachment. d/l are typically prohibited on my work pc via IT-Security)

To get at the SQL,
Open the underlying query in design mode.
If it doesn't open in SQL view, then in a blank area where the tables are shown, right click, in the pop-up menu, select SQL View.
You will now be shown a window where the SQL query text is shown.
Please cut and paste this to a post, highlight the text, and then click on the [CODE/] format button to place the required [code] [/code] tags around your SQL.
Aug 15 '13 #7
1,278 Recognized Expert Top Contributor
I was not suggesting your users should use datasheet mode. Far from it. I merely used datasheet mode to prove that you are using an update-able recordset.

I'm going to post your query's SQL code in the next post. Would you please tell us:
1: Is the relationship between Designation and Establishment 1 to 1 or 1 to many?
2: Is the relationship between Establishment and Structure 1 to or 1 to many?

Aug 15 '13 #8
1,278 Recognized Expert Top Contributor
Here's the query for the form in question:
Expand|Select|Wrap|Line Numbers
  2.    , ESTABLISHMENT.Post_idLevel
  3.    , Designation.Designation
  4.    , ESTABLISHMENT.PostGrade
  5.    , STRUCTURE.Cluster_Name
  6.    , STRUCTURE.ServiceUnit_Name
  7.    , STRUCTURE.Department_Name
  8.    , STRUCTURE.Branch_Name
  9.    , STRUCTURE.Division_Name
  10.    , STRUCTURE.Section_Name
  11.    , STRUCTURE.SubSection_Name
  12.    , STRUCTURE.Cluster_ID
  13.    , STRUCTURE.ServiceUnit_ID
  14.    , STRUCTURE.Department_ID
  15.    , STRUCTURE.Branch_ID
  16.    , STRUCTURE.Division_ID
  17.    , STRUCTURE.Section_ID
  18.    , STRUCTURE.SubSection_ID
  19. FROM Designation 
  22.          ON (ESTABLISHMENT.Cluster_Code 
  23.             = STRUCTURE.Cluster_ID)
  24.           AND (ESTABLISHMENT.Branch_Code 
  25.             = STRUCTURE.Branch_ID) 
  26.           AND (ESTABLISHMENT.Section_Code 
  27.             = STRUCTURE.Section_ID) 
  28.           AND (ESTABLISHMENT.SubSection_Code 
  29.             = STRUCTURE.SubSection_ID)
  30.           AND (ESTABLISHMENT.Division_Code 
  31.             = STRUCTURE.Division_ID)
  32.           AND (ESTABLISHMENT.Dept_code 
  33.             = STRUCTURE.Department_ID)
  34.           AND (ESTABLISHMENT.Unit_Code
  35.             = STRUCTURE.ServiceUnit_ID))
  36.     ON Designation.DesignationID 
  37.       = ESTABLISHMENT.DesignationID;
Aug 15 '13 #9
6 New Member
1: Is the relationship between Designation and Establishment 1 to 1 or 1 to many?
Ans:1 to many
2: Is the relationship between Establishment and Structure 1 to or 1 to many?
Ans1 to 1

I have been able to add new information but now I encounter a new error "index or primary key cannot contain a null value" while every field in a form have been entered.
Aug 16 '13 #10

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

Similar topics

by: EricRobineau | last post by:
hello I have a DB with many inter-related tables (MySQL) My main table called "content" has almost only foreign keys (integers) some have a 3 level relation (ex: content->city->region->country) I would like admins to be able to insert new records including all the "content" fields (in 1 page form) But how can I make an insert form that would display the related tables as list menus instead of a textfield with a number? (ex: select
by: Rose | last post by:
I want to use the javascript dom to reference the field of a record in a multi-record html form when that field has been changed. How do I reference the field? I have a JavaScript function coded as: var zownerID = document.updOwners.ownerID.value var zownerName = document.updOwners.ownerName.value document.updOwners.mysql_update.value = zownerID document.updOwners.newName.value = zownerName I have tried calling it from onclick for...
by: noname | last post by:
I have no clue where to start. Do I have another table of parts?
by: Dan Williams | last post by:
Anyone know if i can take advantage of the datagrid features and use it in a vertical format to view and edit one record from a database? For example, Name: Address: Town: County:
by: San | last post by:
Hey, I need to create a form with several text boxes in which users type in key words, press a command button on the form and it opens a matching record. Thanking you in advance.
by: reidarT | last post by:
I have 3 fields in an aspx page. The 3. field should be the sum of field A and field B I use OnTextChanged to calculate the sum in field3. At the same time I want to insert the content of theese 3 fields into a row in a table. The problem is that I need 'postback is true' on the textfields to get an immediate calculation and then the insert action is triggered. reidarT
by: alex.gruenther | last post by:
I am new to Access and need help creating an edit record form. I've got a table called Player with attributes like name, address, phone, etc. I've created an edit player form with a combo box that gets populated with a list of all the players (run from a lookupplayer query). When I select a user it gives the unique player ID. Now my problem, how do I take the unique ID to select that player's record to edit? The bottom part of the...
by: guessvic | last post by:
Hello everyone, Does anyone know why after using the insert record function that Dreamweaver provides for ASP JavaScript page, then you CANNOT pass the value in the text field inside the form to another page?? Please help. Vic.
by: Susan Bricker | last post by:
I have a form that displays record information in Continuous Record display (scrollable list). One of the fields in the record is an Integer value called "rcode" (reason code). But, I don't want to display the reason code integer value. I want to display the reason code descriptive text (string data). So I have a TEXT BOX object on the form to display the text. I have an public array defined(global variable defined in CommonProcs...
by: Robert Ingles | last post by:
I have a situation where my users need to enter details about new laptops into a table via FRMCreateNewLaptopID - the FRMCreateNewLaptopID includes a UserID field to identify the primary user. They want to enter data into the UserID field in FRMCreateNewLaptopIDand click a confirmation button to see if the user does not exist then FRMCreateNewUserWhileBooking should open so they can enter the new user details which will be pushed to the...
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
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
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.