Hi Guys
Anybody know what is causing this error "Arguments are of the wrong type or are in conflict with one another." or how can I trace it. It occurs when I add a new record. The data is added but this error is also displayed.
Cheers
It must be the references problem.
ADO & DAO
Your code must be having references to ADO & DAO. Avoid either of them and try.
to change go here.
Code Window > Tools > References
HTH
I dont have HTH in my References ? I do use ADO as in is Access Project I am working in and I use ADODB.Recordser and ADODB.Connection. I am not using any DAO references as far as I know.
Gee I feel thick now.
Here is the code anyway.
Private Sub cmdFinished_Click()
'Change the focus back to the main form and hide the data entry form
Forms!frmDrawingscomplete!cboCust.SetFocus
Me.Visible = False
'Make visible and Requery the viewing forms
Forms!frmDrawingscomplete!fsubDrawRev1.Form.Requery
Forms!frmDrawingscomplete!fsubDrawRev1.Form.Visible = True
Forms!frmDrawingscomplete!fsubDraw.Form.Requery
Forms!frmDrawingscomplete!fsubDraw.Form.Visible = True
Dim sql1 As String
Dim str As String
Dim strSQLRestore As String
Dim cnn As Connection
Dim rstDrawings As ADODB.Recordset
Dim strsql1 As String
Dim MyCustPartid As Variant
Dim MyNewCustPartid As String
Dim blnRecordAddred As Boolean
I don't see where in the code you are attempting to add a new record, but I do see where you're attemption to update the last record in the table.
rstDrawings!CustPartid = MyCustPartid
MyCustPartid is declared as a variant, so it may not be a compatible type to rstDrawings!CustPartid. Further, I don't see where MyCustPartid is assigned an actual value, which may mean you trying to assign a Null value to a field type which cannot be null.
Good Luck
-------------- As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
Yippie de do dah youve fixed it. Made both changes and it's sorted. See it really pays to have someone else look at your code (i'm on my own here)
Thanks guys
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.