Why does my code return the value "False"?

In the else part of this procedure, the sql variable returns the string "False" upon debugging and running.  Why?

Private Sub mnuSave_Click()

Dim sql As String

If ValidCustomer Then
    'if new customer
    If txtCustID = "" Then
        sql = "INSERT INTO Customer (CustTitle, CustSurname, CustHouseNo, CustAdd1, CustAdd2, " & _
        "CustTown, CustCounty, CustPostcode, CustHomeTel, CustWorkTel, CustWorkExt, CustMobileTel)" & _
        " VALUES ('" & txtTitle & "', '" & txtSurname & "', " & txtHouseNo & ", '" & txtAddress(0) & _
        "', '" & txtAddress(1) & "', '" & txtTown & "', '" & txtCounty & "', '" & txtPostcode & _
        "', '" & txtHomeTel & "', '" & txtWorkTel & "', '" & txtExtension & "', '" & txtMobile & "')"
        db.Execute sql
    Else
        sql = "UPDATE Customer SET CustTitle = '" & txtTitle & "', CustSurname = '" & txtSurname & _
        "', CustHouseNo = " & txtHouseNo & ", CustAdd1 = '" & txtAddress(0) & "', custadd2 = '" & _
        txtAddress(1) & "', CustTown = '" & txtTown & "', CustCounty = '" & txtCounty & _
        "', CustPostcode = '" & txtPostcode = "', CustHomeTel = '" & txtHomeTel & _
        "', CustWorkTel = '" & txtWorkTel & "', CustWorkExt = '" & txtExtension & _
        "', CustMobileTel = '" & txtMobile & "' WHERE CustID = " & txtCustID
        db.Execute sql
    End If
End If
       
End Sub
andcuAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jeremy_DCommented:
The '=' behind '& txtPostcode' should be a '&'. At this point it's not a string concatenation, but a logical expression I would not care to decypher ;-)

Cheers,
Jeremy
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jeremy_DCommented:
The reason it returns the string "False" is of course because VB will allow you to do almost any horibly wrong assignment without bothering about warning you during compile. In this case it's the inplicit conversion from Boolean type to String type.
0
andcuAuthor Commented:
I thought it must be something like this but I couldn't see the error.


WELL DONE THAT MAN!!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.