klwu
Brainy!!
- Local time
- Today, 11:50
- Joined
- Sep 13, 2004
- Messages
- 47
I have a Maintenance form in my database, where the user can change the ref. no of a particular supplier. This form contains one comboBox (list all the current RefNo of suppliers), and one text field for user to key in preferred RefNo.
I have wrote the following code for the 'Assign' button OnClick Event:
However, this code doesn't work. So, I have no idea how should I write the code. Anyone could guide me on this? Please! Thanks a bunch
I have wrote the following code for the 'Assign' button OnClick Event:
Code:
Private Sub cmdAssign_Click()
On Error GoTo Exit_cmdAssign_Click
Dim sSql As String
Dim dbs As Database
If Not IsNull(cmbSuppRef) And txtNewSuppRef <> "" Then
sSql = "UPDATE M_Suppliers SET SuppRef = '" & txtNewSuppRef & "'" & _
"WHERE SuppRef = '" & cmbSuppRef & "';"
Set dbs = CurrentDb
dbs.Execute sSql
End If
Exit_cmdAssign_Click:
Exit Sub
Err_cmdAssign_Click:
MsgBox Err.Description
Resume Exit_cmdAssign_Click
End Sub
However, this code doesn't work. So, I have no idea how should I write the code. Anyone could guide me on this? Please! Thanks a bunch
Last edited: