troubleshooting Question

Data type conversion error in Access

Avatar of programmher
programmher asked on
Microsoft AccessMicrosoft Development
11 Comments1 Solution951 ViewsLast Modified:
Still in Access.

Here is the code:

If .RecordCount = 1 Then
        .MoveFirst
        If IsEmpty(f!ISBN_ID.Value) = False Then
                If IsEmpty(f!book_ID.Value) = False Then
                  If IsEmpty(f!IDNum.Value) = False Then
                    If IsEmpty(f!Publish_Date.Value) = False Then
                        If f!title_Qty > 0 Then
                            If f!bookPrice > 0 Then
                                    Do Until .EOF
                                        With out
                                            .AddNew
                                            !ISBN_ID = f!ISBN_ID.Value
                                            !book_ID = f!book_ID.Value
                                            !SEQ_NBR = 1
                                            !ID NUM= f!IDNum.Value
                                            !Publish_DATE = f!publish_Date.Value
                                            !title_QTY = f!title_Qty.Value
                                            !QTY_UOM = "PCS"
                                            !Title_PRICE = f!title_price.Value
                                            !Comment_1 = cmt!comment_1
                                            !comment_2 = cmt!comment_2
                                            !book_DESC = f!book_Desc.Value
                                            .Update
                                        End With
                                        .MoveNext
                                    Loop
                               End If
                        End If
                    End If
                End If
            End If
        End If
        Do Until .EOF
   
I get an "Data type conversion error." if I leave the date field blank on my form.  Oddly, the error does not happen if I leave the date field blank the first time I enter my book information.
Two questions:  1.  Why does my first entry work when I leave the date field blank?  2.  How do I resolve the errror?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 11 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 11 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros