Dear Master
I face error in vba code ms access 2010.
and message error is "Subscript out of range (9)"
and normally I can't to solve this is.
this the code
and error in line
bd = Split(bx(1), " ")
Many Thanks for help me
I face error in vba code ms access 2010.
and message error is "Subscript out of range (9)"
and normally I can't to solve this is.
this the code
Code:
Private Sub show() Dim at, bb, url As String Dim bc, bd, be, j, bx As Variant Dim i, t As Integer Dim tbb, tb2 As Variant For i = 0 To 10 Me("p" & i).Caption = "" Me("p" & i).Visible = False Next i status.Caption = "" If InternetGetConnectedState(0&, 0&) Then url = "my_site.com/showdata_rev.php" at = fcSend("&page=" & fpage, url) Text5 = at If Text5 <> "" Then f1.SourceObject = "" f1.Visible = False Text7.Visible = False Text5 = Replace(Text5, vbTab, "") Text5 = Replace(Text5, vbCr, "") Text5 = Replace(Text5, vbLf, "") bb = "" bx = Split(Text5, "<>") bd = Split(bx(0), "~") tbb = "try_" hp_tb (tbb) DoCmd.RunSQL "CREATE TABLE " & tbb _ & " (idemployee Number,rectime datetime," _ & " FirstName Text(255), MiddleName Text(255)," _ & " LastName Text(255), Placebirth Text(255)," _ & " datebirth datetime, passport text(10)," _ & " 1starrivedate datetime," _ & " leavedate datetime,address text(255)," _ & " email1 text(255),telp number,status text(50),nationality text(255));" ', DateBirth DateTime);" Set db = CurrentDb For i = 0 To (UBound(bd) - 1) bb = "" bc = Split(bd(i), "|") For t = 0 To UBound(bc) bb = bb & cek_isi(HtmlToText(bc(t)), IsNumeric(HtmlToText(bc(t)))) & ", " Next t bb = Trim(bb) bb = Left(bb, (Len(bb) - 1)) db.Execute "insert into " & tbb & " values" _ & " (" & bb & ")" Next i db.Close Set db = Nothing bd = "" bd = Split(bx(1), " ") For i = 0 To (UBound(bd) - 1) Me("p" & i).Caption = bd(i) Me("p" & i).Visible = True Next i status.Caption = Trim(bx(2)) If UBound(bd) < 1 Then bb = "Nothing found data" f1.Visible = False Text7.Visible = True Else f1.SourceObject = "f1" f1.Form.RecordSource = tbb f1.Visible = True End If Else bb = "Wrong Destination" End If For i = 0 To 10 If Me("p" & i).Caption = "" Then Me("p" & i).Visible = False End If Next i Else MsgBox "Connection Internet is problem." & vbCrLf _ & "Please try again" & vbCrLf _ & "with other session", , ":: Disconnect" End If End Sub
bd = Split(bx(1), " ")
Many Thanks for help me
Comment