Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2010
    Posts
    25

    Post Unanswered: URGENT: Getting Run time error 3421, Data type conversion error

    Hi,

    I am getting an error Run time error '3421', Data type conversion error. I have mentioned the code used. Can some one help. It is very urgent.

    Private Sub cmdsave_Click()
    Dim Rs As Recordset
    Set Rs = CurrentDb.OpenRecordset("Utilization_Tracker", dbOpenDynaset)
    Rs.AddNew
    Rs![Entry_Date] = Me.txtDate
    Rs![Team_Name] = Me.cboTeam_N
    Rs![Activity_Name] = Me.cboActivity_N
    Rs![Team_Mem_Name] = Me.txtGID
    Rs![#_of_items/Doc_Processed] = Me.txtitems
    Rs![Comments] = Me.txtcomments
    Rs![Total_Time] = Me.txtTTime
    Rs.Update
    Rs.Close
    Set Rs = Nothing
    MsgBox "Record Saved"
    Last edited by sabyds; 09-03-13 at 12:59.

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    On what line? One possible fix:

    Dim Rs As DAO.Recordset
    Paul

  3. #3
    Join Date
    Nov 2011
    Posts
    413
    You might also check out this link. How To Fix (Error 3421) ?

  4. #4
    Join Date
    Jun 2007
    Location
    Maitland NSW,Australia
    Posts
    388
    I would look at these lines
    Rs![Entry_Date] = Me.txtDate
    Rs![Total_Time] = Me.txtTTime

    Also I would place the following lines of code amongst your code

    Rs![Entry_Date] = Me.txtDate
    Rs![Team_Name] = Me.cboTeam_N
    Rs![Activity_Name] = Me.cboActivity_N
    msgbox("Ok Here 1")
    Rs![Team_Mem_Name] = Me.txtGID
    Rs![#_of_items/Doc_Processed] = Me.txtitems
    Rs![Comments] = Me.txtcomments
    msgbox("Ok Here 2")
    Rs![Total_Time] = Me.txtTTime

    This will tell you the lines of code that has the error e.g. if Ok Here 1 is displayed and then the error message is displayed then you know the error is between Ok Here1 and Ok Here 2. The using the process of elimination of moving the Ok Here 2 up one line if you do not get the error message then you know the error is in the line of code after Ok Here 2 message.

  5. #5
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,424
    Provided Answers: 8
    Poppa smurf u got my vote same thinking
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    personally I'd set a breakpoint on the rs.addnew line, then step through the code and make certain all values are sane.


    ..but each to their own
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •