Access Error 13
Contents |
One games Xbox 360 games PC access error 13 type mismatch games Windows games Windows phone games Entertainment All
Ms Access Error 13 Type Mismatch
Entertainment Movies & TV Music Business & Education Business Students & access runtime error 13 educators Developers Sale Sale Find a store Gift cards Products Software & services Windows Office Free downloads & security
How To Fix Runtime Error 13 Type Mismatch
Internet Explorer Microsoft Edge Skype OneNote OneDrive Microsoft Health MSN Bing Microsoft Groove Microsoft Movies & TV Devices & Xbox All Microsoft devices Microsoft Surface All Windows PCs & tablets PC accessories Xbox & games Microsoft Band Microsoft run time error 13 type mismatch excel Lumia All Windows phones Microsoft HoloLens For business Cloud Platform Microsoft Azure Microsoft Dynamics Windows for business Office for business Skype for business Surface for business Enterprise solutions Small business solutions Find a solutions provider Volume Licensing For developers & IT pros Develop Windows apps Microsoft Azure MSDN TechNet Visual Studio For students & educators Office for students OneNote in classroom Shop PCs & tablets perfect for students Microsoft in Education Support Sign in Cart Cart Javascript is disabled Please enable javascript and refresh the page Cookies are disabled Please enable cookies and refresh the page CV: {{ getCv() }} English (United States) Terms of use Privacy & cookies Trademarks © 2016 Microsoft
be down. Please try the request again. Your cache administrator is webmaster. Generated Fri, 30 Sep 2016 01:05:14 GMT by s_hv1002 (squid/3.5.20)
here for a quick overview of the site Help Center Detailed answers to any questions you might have http://stackoverflow.com/questions/325383/access-runtime-error-13-type-mismatch Meta Discuss the workings and policies of this site About Us http://stackoverflow.com/questions/29542733/ms-access-vba-getting-error-13-type-mismatch-when-calling-a-function-from-a Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just error 13 like you, helping each other. Join them; it only takes a minute: Sign up Access: Runtime error 13 type mismatch up vote 1 down vote favorite I am getting a runtime error 13 at the end of the following code: Sub plausibilitaet_check() Dim rs As DAO.Recordset Dim rs2 As ADODB.Recordset Dim db As database Dim strsql As error 13 type String Dim strsql2 As String Dim tdf As TableDef Set db = opendatabase("C:\Codebook.mdb") Set rs = db.OpenRecordset("plausen1") Set rs2 = CreateObject("ADODB.Recordset") rs2.ActiveConnection = CurrentProject.Connection For Each tdf In CurrentDb.TableDefs If Left(tdf.Name, 4) <> "MSys" Then rs.MoveFirst strsql = "SELECT * From [" & tdf.Name & "] WHERE " Do While Not rs.EOF On Error Resume Next strsql2 = "select * from table where GHds <> 0" Set rs2 = CurrentDb.OpenRecordset(strsql2) The error occurs at Set rs2 = CurrentDb.OpenRecordset(strsql2) Can someone see where I am going wrong? ms-access share|improve this question edited May 11 '11 at 14:28 BTB 1,01331321 asked Nov 28 '08 at 9:46 tksy 981123756 add a comment| 2 Answers 2 active oldest votes up vote 2 down vote accepted You are mixing up ADO and DAO. In this case rs2 should be a DAO recordset. Sub plausibilitaet_check() Dim rs As DAO.Recordset Dim rs2 As DAO.Recordset Dim db As database Dim strsql As String Dim strsql2 As String Dim tdf As TableDef Set db = opendatabase("C:\
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up MS Access VBA: Getting Error '13': Type Mismatch when calling a function from a different form up vote 1 down vote favorite Edit: problem has been solved. See my answer in a separate post below! I have two forms: Calendar and frmMagnet. When a text box in Calendar is clicked, it opens frmMagnet and is supposed to call a function declared in frmMagnet. But when I click on the text box, I get Error 13. Global Vars Private CalendarArray(42, 2) As Variant CalenderArray initialization Private Sub InitVariables() intMonthSelect = Month(CDate(CStr(Me.MonthComboBox) & " 1")) intYearSelect = Me.YearComboBox lngDate = CLng(DateSerial(intYearSelect, intMonthSelect, 1)) strUnscheduledJobs = "" 'Initialize CalendarArray Dim i As Integer For i = 0 To UBound(CalendarArray) - 1 CalendarArray(i, 0) = lngDate - Weekday(lngDate) + 1 + i CalendarArray(i, 1) = CStr(Day(CalendarArray(i, 0))) Next i End Sub Calendar method opening the magnet form Private Sub text1_DblClick(Cancel As Integer) If Len(Me.ActiveControl.Text) > 2 Then Call OpenTextBox(Me.ActiveControl.Name) End If End Sub Private Sub OpenTextBox(ctlName As String) Dim ctlValue As Integer Dim DayOfMonth As Long ctlValue = Me.Controls(ctlName).Tag DayOfMonth = CalendarArray(ctlValue - 1, 0) DoCmd.OpenForm "frmMagnet" Call Forms("frmMagnet").PopulateHeaderText(DayOfMonth) 'THE ERROR IS ON THIS LINE!!!!! End Sub frmMagnet method Public Sub PopulateHeaderText(theDate As Long) Me.Controls(HeaderText) = CStr(theDate) End Sub Thank you! vba ms-access-2013 type-mismatch share|improve this question edited Apr 13 '15 at 2:51 asked Apr 9 '15 at 15:27 Mike 160113 Please include CalenderArray method implementation. –PaulFrancis Apr 9 '15 at 15:41 Just added that to the post. Thanks. –Mike Apr 9 '15 at 15:47 None of your VBA seems to be built events from the forms. I see no textbox_click or Form_Open subroutines and I see no functions in above code. Consider calling PopulateHeaderText subroutine in the OnOpen event of frmMagnet. –Parfait Apr 9 '15 at 16:20 I updated the code with one of my double click functions (they all follow t