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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

display field contents as ticks on form

Status
Not open for further replies.

clarimuse

Instructor
Mar 6, 2005
3
DE
I have a table that has 2 fields for userID and group. The group field is restricted to a list of 17 different items.
I would like the user to be able to tick off all the items that apply by checking boxes on a form and have those records added to the table. I also need to be able to read back those records to show as tick boxes. I can't find any way to do this apart from abandoning this table design and having a table with userID and another 17 yes/no fields. Unfortunately this second solution is a real pain to query in the way that I need.
Has anyone any solutions to this sort of problem.
Clarimuse
 
I guess you could do something like this:
Code:
Private Sub Form_Current()
Dim i
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("Select * from personitem where ID=" & Me.ID)
For i = 1 To 17
    Me("chk" & i) = False
Next
Do While Not rs.EOF()
    Me("chk" & rs!Item) = True 
    rs.MoveNext
Loop
End Sub
Where the check boxes are labelled chk1 to chk17 to match the items in the recordset. I found adding and deleting records with this setup was just as awkward as the above.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top