Access 2010 Runtime Error 3421
Contents |
type conversion error. If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: data type conversion error vba click the register link above to proceed. To start viewing messages, select the
Runtime Error '3421' Application Uses Value Of The Wrong Type
forum that you want to visit from the selection below. Results 1 to 6 of 6 Thread: VBA error: Run-time data type conversion error access error 3421: Data type conversion error. Tweet Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Jul 4th, 2014,09:48 AM #1 Arcadia01
Error 3421 Access
View Profile View Forum Posts Thread Starter Junior Member Join Date Nov 2013 Posts 16 VBA error: Run-time error 3421: Data type conversion error. The whole day i'm strugeling to solve this issue but it seems i can't come any further with this In Access i have made a report with a button that has to open a e-mail message and insert the filtered data data type conversion error vba access of the training days. But the problem is i can't do this because the 2 parameters from the query that is linked to the report are blocking it. And i used the vba code below that should be working but it does not and it gives the following error message: VBA error Run-time error 3421: Data type conversion error. And the following line is highlighted in yellow: qdf.Parameters("[van: dd-mm-yy]") = Format(InputBox("van: dd-mm-yy", "Start Date", Format(Date, "dd-mm-yy")), "\#mm\/dd\/yyyy\#") The SQL query that is linked with the report is as follow Code: PARAMETERS [van: dd-mm-yy] DateTime, [tot: dd-mm-yy] DateTime; SELECT TrainingCalender.Title, TrainingCalender.Location, TrainingCalender.[Start Time], TrainingCalender.[End Time], TrainingCalender.Description, [Training description].[Training description] FROM TrainingCalender LEFT JOIN [Training description] ON TrainingCalender.Title = [Training description].Title WHERE (((TrainingCalender.[Start Time])>=[van: dd-mm-yy]) AND ((TrainingCalender.[End Time])<=[tot: dd-mm-yy])); And below you can see the VBA code i'm using: Code: Private Sub Command18_Click() Dim objOutlook As Outlook.Application Dim objOutlookMsg As Outlook.MailItem Dim objOutlookRecip As Outlook.Recipient Dim objOutlookAttach As Outlook.Attachment Dim qry As QueryDef Dim rst As Recordset Dim db As DAO.Database Dim qdf As DAO.QueryDef Dim prm As Parameter ' Create the Outlook session. Set objOutlook = CreateObject("Outlook.Application") ' Create the message. Set objOutlookMsg = objOutlook.CreateItem(olMailItem) W
Question Need help? Post your question and get tips & solutions from a community of 418,417 IT Pros
Runtime Error 3421 Access
& Developers. It's quick & easy. Runtime error 3421,Data type conversion error P: 66 shalskedar I want to transfer the excel data to th Db ..thru the VBA code. In the DB there is a table called outer2 containing 1 of the columns as "Upvc" whose format is set to Long integer. When i try to transfer http://www.vbforums.com/showthread.php?769899-VBA-error-Run-time-error-3421-Data-type-conversion-error the data from my excel sheet to Db,I get Data type conversion error.. What do i do to eliminate this error.Below is my vba code for transfer of data frm excel to access Expand|Select|Wrap|Line Numbers subkd() DimdbAsDAO.Database DimrsAsDAO.Recordset DimrrAsRange DimiAsInteger DimrAsLong Setdb=DAO.DBEngine.OpenDatabase() Setrs=db.OpenRecordset("outer2",dbOpenDynaset) MsgBox"done" Forr=2To28 rs.AddNew rs.Fields(1)=Range("A"&r).Value rs.Fields(2)=Range("C"&r).Value rs.Fields(3)=Range("D"&r).Value//errorhere rs.Update https://bytes.com/topic/access/answers/881081-runtime-error-3421-data-type-conversion-error Nextr EndSub Feb 5 '10 #1 Post Reply Share this Question 4 Replies Expert Mod 15k+ P: 29,922 NeoPa It might be a good idea for a Data Type Conversion Error to include the offending data. Please also remember to use the CODE tags. They are not optional and as a full member (next time you post) you will be likely to receive an infraction for further such posts. Feb 5 '10 #2 reply Expert Mod 100+ P: 2,314 TheSmileyCoder Chances are you have some "offending" data in the field. 1) Start by opening the excel sheet and make sure your input data is correct. If that doesn't work 2) Change your code to: Expand|Select|Wrap|Line Numbers debug.printr&":("&Range("D"&r).Value&")" rs.Fields(3)=clng(Range("D"&r).Value) When the code fails, click debug, and look at the immediate window (Ctrl-G) and simply read the largest r value, and the value in parenthesis. The value in parenthesis will be the "problem" value. In the end, if your sure your data is valid, you could do a clng i
Links Social Groups Pictures & Albums Members List Calendar Search Forums Show Threads Show Posts Tag Search Advanced Search Find All Thanked Posts Go to Page... http://www.access-programmers.co.uk/forums/showthread.php?t=226717 Thread Tools Rating: Display Modes 05-21-2012, 07:04 AM #1 tegb Newly Registered User Join Date: Feb 2012 Posts: 49 Thanks: 9 Thanked 0 Times in 0 Posts 3421: data type conversion error I have a textbox on a form for entering date. this field is optional meaning it could be blank. when I leave this field blank & click save to update table (table runtime error is not bound to form), I get 3421 data type conversion error. how can i get this field to accept blanks as well as dates? it works perfectly alright when a date is entered tegb View Public Profile Find More Posts by tegb 05-21-2012, 07:14 AM #2 pr2-eugin Super Moderator Join Date: Nov 2011 Location: Bournemouth, UK Posts: 8,496 data type conversion Thanks: 68 Thanked 2,050 Times in 2,003 Posts Re: 3421: data type conversion error could we see the update query that you are using? __________________ Regards, Paul Eugin To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. !! Windows 7 Professional, MS Access 2010 --------------------------------------------------------------------------------------------------------------------- If the above post has helped you, please click the scales To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. or click the 'Thumbs up'. Cheers. --------------------------------------------------------------------------------------------------------------------- pr2-eugin View Public Profile Visit pr2-eugin's homepage! Find More Posts by pr2-eugin 05-21-2012, 07:31 AM #3 tegb Newly Registered User Join Date: Feb 2012 Posts: 49 Thanks: 9 Thanked 0 Times in 0 Posts Re: 3421: data type conversion error thanks for helping, I am not using a query, i am using the below code Dim db As Database Set db = CurrentDb Dim tblpool As Recordset Dim Sixtyplus As Integer Dim rstemp As Recordset Dim rstemp2 As Recordset Dim rstemp1 As Recordset Dim rstemp3 As Recordset Dim ctl As Control tblpool.AddNew tblpool![Issue1] = Issue1.Value