Error: "To make changes to this field, first save the record." (1 Viewer)

sarahb845

Registered User.
Local time
Today, 14:20
Joined
Jun 19, 2002
Messages
43
I have several combo-boxes on my form that give me the following error: "To make changes to this field, first save the record." This error only occurs when trying to change the value of the combo-box the second time within the same record. If I then save the record, and make the change to the combobox, it will accept the change. But, if I change it again, I again get the error.

For example:

Open form
ComboboxEmployeeType is "Active".
Change ComboboxEmployeeType to "On Leave". Accepts change.
Try to Change ComboboxEmployeeType again to something different. This is when the errror appears down in the status bar.


Does anyone know why this is happening on some of my combo-boxes and not others? How can I fix this annoying error?

Thanks,
sarah
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 17:20
Joined
Feb 19, 2002
Messages
43,768
You must have some code in one of the combo's events that is causing this. Post the code for each of the combo's events.
 

sarahb845

Registered User.
Local time
Today, 14:20
Joined
Jun 19, 2002
Messages
43
Here is the code for the 4 comboboxes that I am having trouble with. Just to let you know, there is a 5th combobox that has similar AfterUpdate code, but is not causing a problem.


Combobox1 - cboEmplStatus:
SELECT tblEmployeeStatus.StatusCode, tblEmployeeStatus.StatusDescr
FROM tblEmployeeStatus;

Private Sub cboEmplStatus_AfterUpdate()
' 1 - Cascades (updates) the txtStatusDescr textbox with value
' from 2nd column of the cboEmplStatus combobox's Row Source
' depending on Employee Status chosen.

Me.txtStatusDescr = Me.cboEmplStatus.Column(1) ' 1

End Sub


Combobox2 - cboEmployeeType:
SELECT DISTINCTROW tblEmployeeType.EmployeeTypeCode, tblEmployeeType.EmployeeTypeDescr
FROM tblEmployeeType;

Private Sub cboEmployeeType_AfterUpdate()
' 1 - Cascades (updates) the txtEmployeeTypeDescr textbox with value
' from 2nd column of the cboEmployeeType combobox's Row Source
' depending on Employee Type chosen.

Me.txtEmployeeTypeDescr = Me.cboEmployeeType.Column(1) ' 1

End Sub


Combobox3 - cboFullPartTime:
SELECT DISTINCTROW tblHourType.HourTypeCode, tblHourType.HourTypeDescr
FROM tblHourType;

Private Sub cboFullPartTime_AfterUpdate()
' 1 - Cascades (updates) the txtFullPartTime textbox with value
' from 2nd column of the cboFullPartTime combobox's Row Source
' depending on Full/PartTime chosen.

Me.txtFullPartTime = Me.cboFullPartTime.Column(1) ' 1

End Sub


Combobox4 - cboJobCode:
SELECT DISTINCTROW tblJobCode.JobCode, tblJobCode.JobTitle, tblFLSAStatus.FLSAStatusDescr, tblJobCode.ClassCode, tblJobCode.EEOCode
FROM tblFLSAStatus RIGHT JOIN tblJobCode ON tblFLSAStatus.FLSAStatusCode = tblJobCode.FLSAStatus
ORDER BY tblJobCode.JobCode;

Private Sub cboJobCode_AfterUpdate()
' 1 - Cascades (updates) the txtJobTitle textbox with value from
' 2nd column of the cboJobCode combobox's Row Source depending
' on Job Code chosen.
' AND
' 2 - Cascades (updates) the txtFLSAStatus textbox with value from
' 3rd column of the cboJobCode combobox's Row Source depending
' on Job Code chosen.
' AND
' 3 - Cascades (updates) the txtClassCode textbox with value from
' 4th column of the cboJobCode combobox's Row Source depending
' on Job Code chosen.
' AND
' 4 - Cascades (updates) the txtEEOCode textbox with value from
' 5th column of the cboJobCode combobox's Row Source depending
' on Job Code chosen.

Me.txtJobTitle = Me.cboJobCode.Column(1) ' 1
Me.txtFLSAStatus = Me.cboJobCode.Column(2) ' 2
Me.txtClassCode = Me.cboJobCode.Column(3) ' 3
Me.txtEEOCode = Me.cboJobCode.Column(4) ' 4

End Sub
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 17:20
Joined
Feb 19, 2002
Messages
43,768
Check the properties of the combos to make sure that:
1. The correct column is bound
2. The number of columns is correct
 

sarahb845

Registered User.
Local time
Today, 14:20
Joined
Jun 19, 2002
Messages
43
The Number of Columns are correct.
The Bound Columns are correct.

Remember - this problem only occurs the 2nd time you try to change the value of the combobox within the same record.

I'm stumped!
 

Users who are viewing this thread

Top Bottom