Dear Daama:
Write VBA to access the check boxes on the form and create the SQL code for
the query.
Since all this function is occurring within the form, and will be done by an
event of the form (probably a command button) this code would go into the
forms code.
Tom Ellison
> Hi,
>
[quoted text clipped - 8 lines]
>
> Daama
Daama - 03 Apr 2006 20:07 GMT
Dear Tom,
Thanks a bunch for your suggestions. I want to show you (and to anyone else
who can help) the code i have been trying:
Dim strSQL As String
If (Me.chbxRespondentID = False) AND (Me.chbxLoanType = False) AND _
(Me.chbxLoanAmount= False) Then
MsgBox "You must select at least one Field."
Else
strSQL = "SELECT "
If (Me.chbxRespondentID = True) Then
strSQL = strSQL & "[tblLoan]![Respondent ID], "
End If
If (Me.chbxLoanType = True) Then
strSQL = strSQL & "[tblLoan]![Loan Type], "
End If
If (Me.chbxLoanAmount = True) Then
strSQL = strSQL & "[tblLoan]![Loan Amount], "
End If
strSQL = Left(strSQL, Len(strSQL) - 2) & " FROM tblLoan"
End If
The fields I want to select using the check boxes are the following:
Respondent ID; Loan Type; Loan Amount],
They are all located in one table called tblLoan.
The computer still does not recongnize the code and returns a message saying
[syntax error (missing operator) in query expression.....]
I would appreciate any help.
Thanks,
Daama
>Dear Daama:
>
[quoted text clipped - 12 lines]
>>
>> Daama

Signature
Daama