Just have a series of option buttons, with a border drawn around them so it looks like an option group, but of course if you can select multiple options, then it will not return a single value and you will have to examine each option button
Regards
Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now -
Option groups allow one selection only, but you I've gotten around it by generating a dynamic sql statement on the fly - maybe you can adapt this to your needs....
Function opt_sql()
Dim opt As String, sqlstr As String, X As Byte, z As Long, STATUS As String, altype As String
STATUS = " AND YourTable.Status = '" & Forms!YourForm!cboStatus & "'"
altype = " AND YourTable.Type LIKE '" & Forms!YourForm!cboType & "'"
opt_sql = ""
For X = 1 To 18
opt = Me("OptionShip" & X)
If Me("OptionShip" & X) = -1 Then
Select Case X
Case Is = 1
sqlstr = "YourTable.[opt1]=-1" & STATUS & altype
Case Is = 2
sqlstr = "YourTable.[opt2]=-1" & STATUS & altype
Case Is = 3
sqlstr = "YourTable.[opt3]=-1" & STATUS & altype
Case Is = 4
sqlstr = "YourTable.[opt4]=-1" & STATUS & altype
Case Is = 5
sqlstr = "YourTable.[opt5]=-1" & STATUS & altype
Case Is = 6
sqlstr = "YourTable.[opt6]=-1" & STATUS & altype
Case Is = 7
sqlstr = "YourTable.[opt7]=-1" & STATUS & altype
Case Is = 8
sqlstr = "YourTable.[opt8]=-1" & STATUS & altype
Case Is = 9
sqlstr = "YourTable.[opt9]=-1" & STATUS & altype
Case Is = 10
sqlstr = "YourTable.[opt10]=-1" & STATUS & altype
Case Is = 11
sqlstr = "YourTable.[opt11]=-1" & STATUS & altype
Case Is = 12
sqlstr = "YourTable.[opt12]=-1" & STATUS & altype
Case Is = 13
sqlstr = "YourTable.[opt13]=-1" & STATUS & altype
Case Is = 14
sqlstr = "YourTable.[opt14]=-1" & STATUS & altype
Case Is = 15
sqlstr = "YourTable.[opt15]=-1" & STATUS & altype
Case Is = 16
sqlstr = "YourTable.[opt16]=-1" & STATUS & altype
Case Is = 17
sqlstr = "YourTable.[opt17]=-1" & STATUS & altype
Case Is = 18
sqlstr = "YourTable.[opt18]=-1" & STATUS & altype
End Select
z = Len(opt_sql)
If (Not IsNull(opt_sql) Or opt_sql = "" And Len(opt_sql) > 8 Then
opt_sql = opt_sql & " OR " & sqlstr
Else
opt_sql = sqlstr
End If
End If
Next X
End Function
This is then called by another dynamic sql statement using a multi select listbox:
Dim ctlSource As Control
Dim strItems As String
Dim intCurrentRow As Integer
Set ctlSource = Forms!YourForm!lstMultiSelectListbox
For intCurrentRow = 0 To ctlSource.ListCount - 1
If ctlSource.Selected(intCurrentRow) Then
strItems = strItems & ctlSource.Column(1, intCurrentRow) & ", "
End If
Next intCurrentRow
sql = "SELECT " & Left(strItems, Len(strItems) - 2) & " FROM YourTable"
sql = sql & " WHERE " & opt_sql
sql = sql & " ORDER BY YourTable.ControlNumber;"
the only was i can think of in rder to have just one field which stores the data, is as follows:
1. Design the table = "table 1".
2. Design a second table with the 3 (u can have as many as u like) options, and then save it.
3. In table 1 click on the filed where you wish for the option to be saved and in the properties section select lookup.
4. select the second table.
5. follow the onscreen prompts.
6. Thats it.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.