I'm trying to do something really simple and I keep getting an error.
I have a form with two combo boxes and a text box. The first combo box contains Review Types and the second combo box contains Review Sections based on the review type selected in the first combo box. I want the text box to display the placement of the Review Section based on the selection of the Review Sections combo box.
The first combo box uses a query that contains the ReviewIndex and ReveiwType from a table called Review. The ColumnCount is set to 2, and the ColumnWidths are 0";1". The BoundColumn is 1.
The second combo box uses a query that contains the ReviewSectionIndex, SectionTitle, Placement and ReviewIndex(the criteria for ReviewIndex is set to equal the Review Types combo box value) from a ReviewSection table. The ColumnCount is set to 3, and the ColumnWidths are 0";1";0". The BoundColumn is 1.
I'm trying to set the value of the Placement text box to the value for the 3rd column of the Review Section combo box. I don't want it displayed as another column in the combo box because the user needs to be able to change these numbers.
Here is my code in the AfterUpdate event of the first combo box:
Private Sub cboReviewType_AfterUpdate()
Me.cboReviewSection.Requery
Me.cboReviewSection.SetFocus
Me.cboReviewSection = Me.cboReviewSection.ItemData(0)
Me.txtPlacement.SetFocus
Me.txtPlacement.Text = Me.cboReviewSection.Column(2)
End Sub
Here is my code in the AfterUpdate event of the second combo box:
Private Sub cboReviewSection_AfterUpdate()
Me.txtPlacement.SetFocus
Me.txtPlacement.Text = Me.cboReviewSection.Column(2)
End Sub
Now, this is the problem: Whenever I try to update the text in the txtPlacement textbox (underlined above), I receive this message: 'Run time error 2115: The macro or function set to the BeforeUpdate or ValidationRule property for this field is preventing Microsoft Access from saving the data in the field'.
I do not have anything in the BeforeUpdate event or for the ValidationRule property. Also, if I change the text box to a label and use the label's caption property to display the text it works fine. However, I need to figure out some way to use the text box so the user will be able to change the value.
Any idea??
Thanks.
I have a form with two combo boxes and a text box. The first combo box contains Review Types and the second combo box contains Review Sections based on the review type selected in the first combo box. I want the text box to display the placement of the Review Section based on the selection of the Review Sections combo box.
The first combo box uses a query that contains the ReviewIndex and ReveiwType from a table called Review. The ColumnCount is set to 2, and the ColumnWidths are 0";1". The BoundColumn is 1.
The second combo box uses a query that contains the ReviewSectionIndex, SectionTitle, Placement and ReviewIndex(the criteria for ReviewIndex is set to equal the Review Types combo box value) from a ReviewSection table. The ColumnCount is set to 3, and the ColumnWidths are 0";1";0". The BoundColumn is 1.
I'm trying to set the value of the Placement text box to the value for the 3rd column of the Review Section combo box. I don't want it displayed as another column in the combo box because the user needs to be able to change these numbers.
Here is my code in the AfterUpdate event of the first combo box:
Private Sub cboReviewType_AfterUpdate()
Me.cboReviewSection.Requery
Me.cboReviewSection.SetFocus
Me.cboReviewSection = Me.cboReviewSection.ItemData(0)
Me.txtPlacement.SetFocus
Me.txtPlacement.Text = Me.cboReviewSection.Column(2)
End Sub
Here is my code in the AfterUpdate event of the second combo box:
Private Sub cboReviewSection_AfterUpdate()
Me.txtPlacement.SetFocus
Me.txtPlacement.Text = Me.cboReviewSection.Column(2)
End Sub
Now, this is the problem: Whenever I try to update the text in the txtPlacement textbox (underlined above), I receive this message: 'Run time error 2115: The macro or function set to the BeforeUpdate or ValidationRule property for this field is preventing Microsoft Access from saving the data in the field'.
I do not have anything in the BeforeUpdate event or for the ValidationRule property. Also, if I change the text box to a label and use the label's caption property to display the text it works fine. However, I need to figure out some way to use the text box so the user will be able to change the value.
Any idea??
Thanks.