Hello, I have some doubts creating a new Access, Any help?
:) Thanks in advance.
I have 4 tables (* indicates pk)
All tables are 1-N dependant via the ID Field, this means I can not create a Section without a provided Company, I can not create a Job without a created Section and I can not Create an operation without a Job.
I know this is not nice E-R model, but Im given ER and requested to create the maintenance Form for the Operations.
Then I have created a form:
Then In the Form I have added the following fields:
JobsComboBox.Be foreUpdate code
Then.... I have a few questions ...
1.- I type a value in the OpeOperationTxt , then I select a value from JobsComboBox combo, it updates the OpeJobTxt, OpeSectionTxt, OpeCompanyTxt correctly, then if I press tab, it should create a new record in the 40Operations table, but instead, I have an error:
"You cannot add or change a record because a related record is required in 30Jobs"
I dont understand why it asks this, as the record in 30Jobs table, exists (i selected it from the combobox).
2.- Second question is, how can i stop the form from creating new records, and to do it via clicking a button
Thanks a lot.
[UPDATE]: If i delete the 1-to-N relationship, it creates the row(record) in the 40Operations table
:) Thanks in advance.
I have 4 tables (* indicates pk)
Code:
10Company CompID * CompName CompDesc
Code:
20Section SectCompID * SectID * SectName SectDesc
Code:
30Jobs JobCompID * JobSectID * JobID * JobName JobDesc
Code:
40Operations OpeCompID * OpeSectID * OpeJobID * OpeOperID * OpeName OpeDesc
I know this is not nice E-R model, but Im given ER and requested to create the maintenance Form for the Operations.
Then I have created a form:
Code:
OperationsForm ControlSource = 40Operations
Code:
OpeOperationTxt ControlSource = OpeOperID JobsComboBox ControlSource = OpeJobID Row Source = Select JobID, JobSectID, JobCompID from 30Jobs Bound Column =1 ColumnCount = 3 BeforeUpdate = CodeAfterColumns OpeJobTxt ControlSource = OpeJobID enabled, locked = No OpeSectionTxt ControlSource = OpeSectID enabled, locked = No OpeCompanyTxt ControlSource = OpeCompID enabled, locked = No
JobsComboBox.Be foreUpdate code
Code:
Me.OpeJobTxt = Me.JobsComboBox.Column(0)
Me.OpeSectionTxt = Me.JobsComboBox.Column(1)
Me.OpeCompanyTxt = Me.JobsComboBox.Column(2)
1.- I type a value in the OpeOperationTxt , then I select a value from JobsComboBox combo, it updates the OpeJobTxt, OpeSectionTxt, OpeCompanyTxt correctly, then if I press tab, it should create a new record in the 40Operations table, but instead, I have an error:
"You cannot add or change a record because a related record is required in 30Jobs"
I dont understand why it asks this, as the record in 30Jobs table, exists (i selected it from the combobox).
2.- Second question is, how can i stop the form from creating new records, and to do it via clicking a button
Thanks a lot.
[UPDATE]: If i delete the 1-to-N relationship, it creates the row(record) in the 40Operations table
Comment