This seems to imply that one or the other of your textboxes was empty. What I'd suggest as a debugging aid is to set a break point and copy/paste here the actual string which is being passed to the SQL interpreter. We've seen the code, but I believe we need to see the result of the code.
In other words, set a break point on the Rs.Open statement. When it breaks, go to Immediate window and enter...
[CODE=vb]Print "INSERT INTO Invoice_master( Inv_No,Inv_Date ,Inv_Type,Cust_ Code, Salesman_Code,D ue_Date) VALUES (" & Val(txtInvNo.Te xt) & ",#" & txtDate.Text & "#,'" & txtInvType.Text & "'," & Val(txtCustCode .Text) & "," & Val(txtSaleCode .Text) & ",#" & txtDue.Text & "#)"[/CODE]
Comment