Can anybody tell me why i am getting error in the bold line.
Application uses a value of the wrong type for the current
Operation .?
Private Sub Command2_Click()
If (CheckInput) Then
End If
Y = MsgBox("do you add this record", vbYesNo + vbQuestion, "message")
If Y = vbYes Then
Set Con = New ADODB.Connection
Con.Open ("Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=\\asfserver\itp$\product_tabletest.mdb")
Dim cmd As ADODB.Command
Set cmd = New ADODB.Command
If Not Con Is Nothing Then
With cmd
.ActiveConnection = Con
.CommandType = adCmdText
.CommandText = "INSERT INTO supplier (supplier_name,supplier_id, contact_person, contact_no, type, office_address, emails, website ) VALUES (?,?,?,?,?,?,?,?)"
.Parameters.Append .CreateParameter("@SupplierName", adChar, adParamInput, 20, Text2.Text)
.Parameters.Append .CreateParameter("@SupplierID", adChar, adParamInput, 20, Text1.Text)
.Parameters.Append .CreateParameter("@Contactperson", adChar, adParamInput, 20, Text3.Text)
.Parameters.Append .CreateParameter("@ContactNo", adChar, adParamInput, 20, Text4.Text)
.Parameters.Append .CreateParameter("@Type", adChar, adParamInput, 20, Combo1.Text)
[B] .Parameters.Append .CreateParameter("@OfficeAddr", adChar,[/B] adParamInput, 50, Text5.Text)
.Parameters.Append .CreateParameter("@Emails", adChar, adParamInput, 20, Text6.Text)
.Parameters.Append .CreateParameter("@Website", adChar, adParamInput, 20, Text7.Text)
.Execute
End With
Set Con = Nothing
Else
MsgBox "connection not set"
MsgBox ("Data Saved")
End If
End If
End Sub