Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

repopulating a set of checkboxes from a database.

Status
Not open for further replies.

Mayoor

Programmer
Jan 16, 2004
198
GB
I have a set of user interests which can be set by a set of checkboxes. These interests ID's are then submitted to a database, which is fine. The problem I currently have though is how do I repopulate those checkboxes on my form when the user goes to amend his profile. the code i have so far is as follows but only populates the last user interest for some reason.

Code:
Do while not InterestRS.EOF 									
										RegisteredInterestRS.movefirst
										
										Do while not RegisteredInterestRS.EOF
											
											if RegisteredInterestRS("InterestID") = InterestRS("InterestID") then
												blnInterestChecked = " checked "												
											End if			
													
											RegisteredInterestRS.movenext			
										loop
										
									 %>
										<%=InterestRS("Title")%><INPUT type='checkbox' name='interest' value='<%=InterestRS("InterestID")%>'<%=blnInterestChecked%>  ><br>
										
										<%	
										InterestRS.MoveNext
										
									loop

Can anyoen help please
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top