Ms Access Vba Error 13
Contents |
360 games PC games
Microsoft Visual Basic Runtime Error 13 Type Mismatch Excel
Windows games Windows phone games Entertainment All Entertainment how to fix runtime error 13 type mismatch Movies & TV Music Business & Education Business Students & educators runtime error 13 type mismatch vb6 Developers Sale Sale Find a store Gift cards Products Software & services Windows Office Free downloads & security Internet
Run-time Error 13 Type Mismatch Access
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 Lumia All
Run Time Error 13 Type Mismatch Excel 2013
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
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 compile error type mismatch vba this site About Us Learn more about Stack Overflow the company Business
Type Mismatch Error In Vbscript
Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask runtime error 13 type mismatch excel 2007 Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign https://support.microsoft.com/en-us/kb/181542 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 http://stackoverflow.com/questions/29542733/ms-access-vba-getting-error-13-type-mismatch-when-calling-a-function-from-a 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 pos
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies http://stackoverflow.com/questions/18367779/vba-access-getting-run-time-error-13-type-mismatch 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 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: type mismatch Sign up VBA Access getting Run-time error '13'; Type Mismatch up vote 0 down vote favorite Public Function modCreditmove() Dim fso, CB As String Set fso = CreateObject("Scripting.FileSystemObject") CB = ("H:\Credit*.xls") If CB > 0 Then fso.MoveFile ("H:\Credit*.xls"), "H:\Credit_Archive\" End If End Function This is the code I am using to Move files for archive , I had the code working when error 13 type there were files to move and then it threw an error code when there wasn't any files to move So I tried to add an if statement so there wasn't any error msgs popping up and I got the Run-time error '13', Type mismatch can someone help assist so i can do this the correct way. Thanks vba runtime runtime-error share|improve this question edited Aug 21 '13 at 21:15 alfasin 33.1k73672 asked Aug 21 '13 at 21:11 ELS31987 5128 add a comment| 2 Answers 2 active oldest votes up vote 1 down vote accepted CB is of type String. So when you do CB > 0, it tries to use it as a Integer. If you want to check if there are any files in pattern, you can use Dir. If the result is an empty string, then nothing was found, so you want to move files when dir returns something other than empty. Dim fso Dim filePattern As String filePattern = "H:\Credit*.xls" If Dir(filePattern) <> "" Then Set fso = CreateObject("Scripting.FileSystemObject") fso.MoveFile filePattern, "H:\Credit_Archive\" End If Dir accepts a wildcard pattern, so I thin