Solved

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

Posted on 2004-04-05
3
275 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
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …

856 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