Solved

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

Posted on 2004-04-05
3
248 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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

RIA (Rich Internet Application) tools are interactive internet applications which have many of the characteristics of desktop applications. The RIA tools typically deliver output either by the way of a site-specific browser or via browser plug-in. T…
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.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

744 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now