unbound field error

  • Thread starter Thread starter Ray Bell
  • Start date Start date
R

Ray Bell

I am getting the following error:
"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 am simply trying to pass into an unbound text box a
string. I set focus to the field prior to attempting and
then the error pops up. can anyone help
 
I am getting the following error:
"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 am simply trying to pass into an unbound text box a
string. I set focus to the field prior to attempting and
then the error pops up. can anyone help

Please post your code. This error indicates that you're trying to
update a table field - perhaps the Control Source of the textbox is in
fact not empty.
 
sb = GetComPolicy(ComWork.ProductID, cmboStype.ItemData
(cmboStype.ListIndex))
'Set focus to the unbound text box
cPol.SetFocus
cPol.Text = sb

this control is part of a subform on a tab control. I am
updating the box based on the cmbostype combo box.
 
I found my problem.

I was attempting to change the focus while still fireing
the event of combobox. I changed the code to as follows:

Private sb As String

Private Sub cmboStype_AfterUpdate()
'Dim sb As String
'On Error Resume Next
sb = GetComPolicy(ComWork.ProductID, cmboStype.ItemData
(cmboStype.ListIndex))

End Sub

Private Sub cmboStype_Change()
cPol.SetFocus
cPol.Text = sb
End Sub


This solved the problem. Thanks for your suggestion...it
helped me with my solution Jason.....

Best Regards,
Ray Bell
SiemensWestinghouse Power Corporation
 
Back
Top