Hi,
I am allowing the user to update existing details through textboxes. They select the name of the person they wish to edit from a dropdown menu which is filled on form load. The user may edit any details, however when I try to edit the name in the actual combo box, it brings up an error. The code to date is as follows:
Dim adoconnection As ADODB.connection
Set adoconnection = New ADODB.connection
adoconnection.Open ("Provider=Microsoft.jet.oledb.4.0;" & "Data Source = h:\NewDatabase.mdb"
Set rs = New ADODB.Recordset
rs.Open "Select * from Landlord where Landlord_Name='" & cboName.Text & "'", adoconnection, adOpenDynamic, adLockOptimistic
rs!Landlord_Name = cboName.Text
rs!Address = txtAddr.Text
rs!Tel_No = txtNum.Text
rs!Mobile_No = txMobile.Text
rs.Update
adoconnection.Close
Set rs = Nothing
It is upon changing the name in the textbox that causes the following error...
"Either BOF or EOF is true or the current record has been deleted. Requested operation requires a current record"
Any ideas?
Thanx!
I am allowing the user to update existing details through textboxes. They select the name of the person they wish to edit from a dropdown menu which is filled on form load. The user may edit any details, however when I try to edit the name in the actual combo box, it brings up an error. The code to date is as follows:
Dim adoconnection As ADODB.connection
Set adoconnection = New ADODB.connection
adoconnection.Open ("Provider=Microsoft.jet.oledb.4.0;" & "Data Source = h:\NewDatabase.mdb"
Set rs = New ADODB.Recordset
rs.Open "Select * from Landlord where Landlord_Name='" & cboName.Text & "'", adoconnection, adOpenDynamic, adLockOptimistic
rs!Landlord_Name = cboName.Text
rs!Address = txtAddr.Text
rs!Tel_No = txtNum.Text
rs!Mobile_No = txMobile.Text
rs.Update
adoconnection.Close
Set rs = Nothing
It is upon changing the name in the textbox that causes the following error...
"Either BOF or EOF is true or the current record has been deleted. Requested operation requires a current record"
Any ideas?
Thanx!