I have a form to create a new record for a training course. The form is based on one table that has 4 keys set to primary key.
The first combo box on the form allows selection of the course POP code and this then fills details on 2 list boxs for course module code and description. The course section can then be selected from another combo box (filtered by the value in the first combo box) . Finally the course session name is entered manually. These 4 make a primary key. (POPCode, ModuleCode, Section, Session).
Further details of trainer etc are also filled in a similar manner.
When all of the controls on the form are full (I have ensured they meet referential integrity rules) i still get an "Index/Primary key cannot contain null value" message. I do not understand why as all of the controls have control sources set to the underlying table adn all have a value assigned. Any help is appreciated...
Thanks
12 4490
I can't be sure because I've never set up a table with four primary keys but I imagine Access is having some problems with it. Why not just add a key 'ID' set to autonumber and make it the primary key.
I have a form to create a new record for a training course. The form is based on one table that has 4 keys set to primary key.
The first combo box on the form allows selection of the course POP code and this then fills details on 2 list boxs for course module code and description. The course section can then be selected from another combo box (filtered by the value in the first combo box) . Finally the course session name is entered manually. These 4 make a primary key. (POPCode, ModuleCode, Section, Session).
Further details of trainer etc are also filled in a similar manner.
When all of the controls on the form are full (I have ensured they meet referential integrity rules) i still get an "Index/Primary key cannot contain null value" message. I do not understand why as all of the controls have control sources set to the underlying table adn all have a value assigned. Any help is appreciated...
Thanks
By the way you can still set the other keys to required if that's what you're worried about but they shouldn't need to be part of the primary key.
I can't be sure because I've never set up a table with four primary keys but I imagine Access is having some problems with it. Why not just add a key 'ID' set to autonumber and make it the primary key.
thanks,
true that it was not needed, it works fine with just 1 primary key.
cheers
I have a form to create a new record for a training course.
The first combo box on the form allows selection of the course POP code and this then fills details on 2 list boxs for course module code and description.
Problem: the 2 controls above are not taking the requery-ed value through to the table. The proper data is displayed on the form but when i look at the table being updated, the data is not present. If i (mouse) click on the controls then the value is passed to the table, but if i tab through it, it still isnt passed to the table!
Is there a way to simulate the controls being clicked?
very confused.....
Firstly
What is the Control Source property of each of these fields set to?
regardless of any action if the control source is set to the field in the table then the field should update.
the control source for each control is set to the appropriate field of the table.
Also, the bound column is set to 0.
The value that is selected is from an SQL statement in the controls row source. This is requery-ed after selection of the value in the first combo.
baffling!
Firstly
What is the Control Source property of each of these fields set to?
regardless of any action if the control source is set to the field in the table then the field should update.
Also, the bound column is set to 0.
The bound column needs to be set to 1. The first column is only refered to a 0 when its being used programmatically.
e.g. Me.combobox.Column(0)
thanks, but it still doesnt change things, when i arrow to the next record after entering details, the values in the controls that dont update stay on the form - mean anything to you?
Thanks again,
Aidan
What code are you using on the combo box and in what event did you put it.
Is there any coded event on the two text boxes.
Hi,
sorry i have been away for a few days.
there is a simple code on the combo to requery the 2 controls that i am having the problem with, its placed 'OnChange':
Private Sub POPCode_Change()
Me.ModuleDescription.Requery
Me.ModuleCode.Requery
End Sub
You think this could be thew problem?
thanks
Aidan
Change to the AfterUpdate event and see if that makes a difference. -
-
Private Sub POPCode_AfterUpdate()
-
Me.ModuleDescription.Requery
-
Me.ModuleCode.Requery
-
End Sub
-
-
No help either...this is the row source of one of the controls being requeryed:
SELECT tblTrainingModules.ModuleCode FROM tblTrainingModules WHERE tblTrainingModules.POPCode = Forms!frmTrainingSessions1.POPCode
make any difference?
Sign in to post your reply or Sign up for a free account.
Similar topics
by: heromull |
last post by:
We have an asp.net app with about 200 data entry forms. Customers may
enter data into any number of forms. Each form's data is persisted in
a corresponding sql table. When data entry is...
|
by: Doslil |
last post by:
I have a form which has a subform.In the main form I have only one
field (this is a drop down list and has a query attached to it) which
selects empno,Name from the EmployeeInformation table.
...
|
by: Thomas Paul Diffenbach |
last post by:
Can anyone point me to an open source library of /statically
allocated/ data structures?
I'm writing some code that would benefit from trees, preferably self
balancing, but on an embedded system...
|
by: Jerry |
last post by:
Below is ALL the code for all the databases...
Here's the problem:
I callup the aspx file in IE and the form comes up just fine. When I
select a person to update, I get the subject error. ...
|
by: RottNKorpse |
last post by:
Well I am trying to make an admin section to allow my other admins of my site able to add content to my mysql database without giving them phpmyadmin access and without teaching them out to use it as...
|
by: David Linsin |
last post by:
I created a simple test case to reproduce the problem (also check Bug
#15500):
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;...
|
by: so many sites so little time |
last post by:
ok so i am having problems if you look at the script below you will
see that it the query has 4 values to insert but the actual values only
contain title entry and now() for the date. well i have...
|
by: Maria DiGiano |
last post by:
I am using Access to organize data from a survey which uses a Likert
scale to measure response- the scale is 3 points- "I agree", "I don't
know" and "I disagree". The numerical value of each...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
| |