Hi there
I am trying to learn the Access need help from the guru of Access
Below are the code, which I am trying to use to update the field in a record, What I am trying to achieve, is once I press/click the update button, cursor needs to move to next desire field which is "txteditcid", but after pressing the update button, I am getting following error (however, field is updating in table)
Run-time error '2110':
Microsoft Access can't move the focus to the control txteditcid
Apparently, look like looping issue - but not sure, can someone help-me
Thanks for your valuable comments
Code
Private Sub Butupdatecustemail_Click()
Dim dbs As DAO.Database, update1 As String, rcount As Integer
Set dbs = CurrentDb
update1 = "UPDATE CustomerProfile set custemail='" & Me.txteditcustemail & "'" & "WHERE cid='" & Me.txteditcid & "'"
dbs.Execute update1, dbFailOnError
rcount = dbs.RecordsAffected
If rcount > 0 Then
MsgBox "Field record updated", vbInformation, "Confirmation"
Listeditcustomerprofile.Requery
Me.txteditcustemail.Enabled = False
Cancel = True
txteditcid.SetFocus
Exit Sub
End If
End Sub
I am trying to learn the Access need help from the guru of Access
Below are the code, which I am trying to use to update the field in a record, What I am trying to achieve, is once I press/click the update button, cursor needs to move to next desire field which is "txteditcid", but after pressing the update button, I am getting following error (however, field is updating in table)
Run-time error '2110':
Microsoft Access can't move the focus to the control txteditcid
Apparently, look like looping issue - but not sure, can someone help-me
Thanks for your valuable comments
Code
Private Sub Butupdatecustemail_Click()
Dim dbs As DAO.Database, update1 As String, rcount As Integer
Set dbs = CurrentDb
update1 = "UPDATE CustomerProfile set custemail='" & Me.txteditcustemail & "'" & "WHERE cid='" & Me.txteditcid & "'"
dbs.Execute update1, dbFailOnError
rcount = dbs.RecordsAffected
If rcount > 0 Then
MsgBox "Field record updated", vbInformation, "Confirmation"
Listeditcustomerprofile.Requery
Me.txteditcustemail.Enabled = False
Cancel = True
txteditcid.SetFocus
Exit Sub
End If
End Sub