Solved

Checking HTML ChekBox based on Database values in Visual Basic using Webbrowser controll

Posted on 2004-04-05
3
293 Views
Last Modified: 2008-02-01
Hello
I have to select the checkboxes on a HTML page through Visual Basic code  based on Access Database(Located on my C drive) .HTML page is displayed in Visual Basic's Webbrowser control.Now 10 checboxes are displayed at one time.Each text box has a name exactly equal to the values in my database table.Database contains values of many students but I want to check those checkboxes which have the Name equal to ID of my students(There is a mixed data of all students).
Help me so that I can check those check boxes whose Name is exactly equal to my Students ID.
I tried this but failed.
Dim doc as HTMDocument
Private Sub Check_Click()
While Not adors.EOF
'it will create error if checkbox not found
doc.frm.adors.Fields("St_No").checked=True
Wend
End Sub
Waiting for quick responce.
Masood Akhtar (tatral1@hotmail.com)
0
Comment
Question by:tatral
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 10

Accepted Solution

by:
Kavar earned 125 total points
ID: 10759878
change

doc.frm.adors.Fields("St_No").checked=True

to

GetControl(doc.frm.adors.Fields("St_No").value).checked=true

then add a function

Function GetControl(WhatControlName as string) as checkbox
  for each c in me.controls
    if lcase(c.name)=lcase(whatControlName) then
      set GetControl=c
      exit function
    end if
  next
end function
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A short article about problems I had with the new location API and permissions in Marshmallow
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Simple Linear Regression

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question