cactus1000
Programmer
I asked a similar question a few days ago, but I'm still stuck.
Each record on my database has a name field which must be filled out, however, users can check "anonymous" on the web form if they wish for their names to be hidden.
So, when output is displayed, the names should be displayed for everyone except those who checked "anonymous"
So I have an If statement:
If (objrs.Fields.Item("anonymous"
) = "Yes" Then
Do While Not objrs.EOF
Response.Write (field1)
Response.Write (field2)
objRS.MoveNext
Loop
End If
If (objrs.Fields.Item("anonymous"
) = "No" Then
Do While Not objrs.EOF
Response.Write (Name)
Response.Write (field1)
Response.Write (field2)
objRS.MoveNext
Loop
objRS.Close
Set objRS = Nothing
End If
What this is doing is checking the recordset -- if the first record's "anonymous" field is "yes" it applies the "Yes" criteria to all records. If the first record is a "No", it applies the "No" criteria to all records.
How can I get this If statement to execute for each individual record?
Or, rather than having alternate Response.Write options, is there a way to hide the name field based on the contents of the "anonymous" field?
Each record on my database has a name field which must be filled out, however, users can check "anonymous" on the web form if they wish for their names to be hidden.
So, when output is displayed, the names should be displayed for everyone except those who checked "anonymous"
So I have an If statement:
If (objrs.Fields.Item("anonymous"
Do While Not objrs.EOF
Response.Write (field1)
Response.Write (field2)
objRS.MoveNext
Loop
End If
If (objrs.Fields.Item("anonymous"
Do While Not objrs.EOF
Response.Write (Name)
Response.Write (field1)
Response.Write (field2)
objRS.MoveNext
Loop
objRS.Close
Set objRS = Nothing
End If
What this is doing is checking the recordset -- if the first record's "anonymous" field is "yes" it applies the "Yes" criteria to all records. If the first record is a "No", it applies the "No" criteria to all records.
How can I get this If statement to execute for each individual record?
Or, rather than having alternate Response.Write options, is there a way to hide the name field based on the contents of the "anonymous" field?