I have a subform (datasheet) that has a textbox to enter a date and a combobox. The combobox values are populated from a query and the results is stored into a sql database.
What I need to do is if an operator enters a date in the date field to populate the combobox with a default value from the query list.
In the textbox AfterUpdateEvent I placed the following code (the default code is the second record in the query):
When I enter a date in the text field and tab off or go to the next record it errors out on the ListIndex = 1 line with the following message:
"The macro or function set to the BeforeUpdate or ValidationRule property for this field is preventing STARR from saving the data in the field."
I don't have any macro's or functions set up for this field so I don't know where it's getting it from.
The field in the sql table is 4 characters and none of the entries in the combobox are over 4 so I know it's not a truncation problem.
As a further test I set up another combobox and entered the values in rather than from a table thinking the query may be the problem but the same thing happened.
Any ideas or suggestions would be appreciated.
We are running Access 2007 and if you need further information, please let me know.
What I need to do is if an operator enters a date in the date field to populate the combobox with a default value from the query list.
In the textbox AfterUpdateEvent I placed the following code (the default code is the second record in the query):
Code:
Me.Inspection_Code.SetFocus
Me.Inspection_Code.ListIndex = 1
When I enter a date in the text field and tab off or go to the next record it errors out on the ListIndex = 1 line with the following message:
"The macro or function set to the BeforeUpdate or ValidationRule property for this field is preventing STARR from saving the data in the field."
I don't have any macro's or functions set up for this field so I don't know where it's getting it from.
The field in the sql table is 4 characters and none of the entries in the combobox are over 4 so I know it's not a truncation problem.
As a further test I set up another combobox and entered the values in rather than from a table thinking the query may be the problem but the same thing happened.
Any ideas or suggestions would be appreciated.
We are running Access 2007 and if you need further information, please let me know.