Sub Button1_OnClick Dim addrurl,Ms if IsNumeric(Text1.Value) Then if CInt(Text1.Value) < 1 Or CInt(Text1.Value) > endpage Then Ms="الرقم المدخل خارج نطاق صفحات الكتاب ادخل رقم بين 1 و "&endpage&" ـ " alert(Ms) Text1.Value=Pagenum Text1.focus( ) Text1.Select Else C="" FOR i = 1 To LEN(nonPage) C = MID(nonpage, i, 1) SELECT CASE C CASE "," IF c1 = Trim(Text1.Value) THEN alert("لا توجد صفحة بهذا الرقم") Text1.Value=Pagenum Text1.focus( ) Text1.Select EXIT FOR ELSE c1="" END IF CASE ELSE c1 = c1 + C END SELECT NEXT SELECT CASE Trim(Text1.Value) CASE Pagenum Text1.Value=Pagenum Text1.Select Text1.focus( ) CASE ELSE addrurl="a"&Trim(Text1.Value)&".htm" document.URL=addrurl Text1.Value=Pagenum Text1.Select Text1.focus( ) END SELECT End If Else alert("الرجاء ادخال قيمة عددية") Text1.Value=Pagenum Text1.focus( ) Text1.Select End If End Sub Sub Text1_Onfocus Text1.Value=Pagenum Text1.Select Text1.focus( ) end sub