I have a form with a subform(I suppose it doesn`t matter too much). I set an AfterUpdate method for the last component (combo box) of the form. That method should retrieve the values of all the fields of the form and send them into a database. For that I need to set the focus on the each component of the form. But, unfortunatelly, when I want to set the focus on the first component (which is an enabled and active field), I get the following error:
"Validation Rule property for this field is preventing Microsoft Access from saving data in the field."
How can I solve this problem?
The code look like the above one:
This code runs, but I get the error listed above. More than that, the vNRCDA variable is displayed correctly.
OK, if I try the next code:
then I get the previous error, and, after it, I get another one:
Run-time error '2115':
Validation Rule property for this field is preventing Microsoft Access from saving data in the field.
How can I solve the problem?
Thank you in advance!
"Validation Rule property for this field is preventing Microsoft Access from saving data in the field."
How can I solve this problem?
The code look like the above one:
Code:
Private Sub cboAdrese_AfterUpdate()
' Declar variabilele auxiliare
Dim vNRCDA, vtxtCodPartn, vcboAdrese As String
NRCDA.SetFocus
vNRCDA = NRCDA.Text
' txtCodPartn.SetFocus
' vtxtCodPartn = txtCodPartn.Text
' cboAdrese.SetFocus
' vcboAdrese = cboAdrese.Text
MsgBox vNRCDA
MsgBox vtxtCodPartn
MsgBox vcboAdrese
End Sub
OK, if I try the next code:
Code:
Private Sub cboAdrese_AfterUpdate()
' Declar variabilele auxiliare
Dim vNRCDA, vtxtCodPartn, vcboAdrese As String
NRCDA.SetFocus
vNRCDA = NRCDA.Text
' txtCodPartn.SetFocus
' vtxtCodPartn = txtCodPartn.Text
cboAdrese.SetFocus
vcboAdrese = cboAdrese.Text
MsgBox vNRCDA
MsgBox vtxtCodPartn
MsgBox vcboAdrese
End Sub
Run-time error '2115':
Validation Rule property for this field is preventing Microsoft Access from saving data in the field.
How can I solve the problem?
Thank you in advance!