Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2004-04-05
3
Medium Priority
?
296 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 500 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

719 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