Hello, Im a little bit sad and frustrated that I cannot figure out what the problem is by myself but i got to my limit so ill post here hoping to get some help
I have a form which links to a bunch of different tables for various reasons but one of them is called "Suppliers" (theres a drop down menu to select an option in suppliers)
Im set to make another form that allows you to add another supplier so I have set up the table and the form and just need to code the form to get it to do what I want it to.
Everything seems to be working apart from the important button that Adds whatever you entered in a textbox into "Suppliers" table
Code:
Private Sub btnaddsupplier_Click()
On Error GoTo Err_btnaddsupplier_Click
Dim dbs As DAO.Database
Dim NewSuppl As String
Dim InsertSQL
Set dbs = CurrentDb
If (IsNull(NewSupplier.Value) = False) And (NewSupplier <> "") Then
NewSuppl = NewSupplier.Value
Else
MsgBox "New Supplier Box cannot be blank."
End If
InsertSQL = "UPDATE [Suppliers] set " + _
"[Suppliers].[Suppliers] = '" + NewSuppl + "',"
dbs.Execute InsertSQL
Exit_Supplier_Click:
Exit Sub
Err_btnaddsupplier_Click:
Resume Exit_Supplier_Click
MsgBox Err.Description
End Sub
Im not sure where the problem is or why I cannot spot it but maybe someone with a clearer eye can give me a solution and point out what ive done wrong here.
thanks in advanced! (ps when you type nothing in the box, i do get the messagebox popup)