At Your Survey Question

G

Guest

I have downloaded Duane Hookom's "At Your Survey" database. I have been
looking around the database, which looks really good and thorough,
I do have a question about some code on one of the forms that doesn't appear
to be doing what it should. The code in question is:

Private Sub Form_Current()
Rspns.Requery
Me![Rspns].LimitToList = Me!LmtLst
If Me![RspnsType] = 1 Then
Me![Rspns].RowSourceType = "Value List"
Me![Rspns].RowSource = "Yes;No"
Else
Me![Rspns].RowSourceType = "Table/Query"
Me![Rspns].RowSource = "SELECT tblResponsesList.Rspns FROM
tblResponsesList WHERE
((tblResponsesList.QstnID=[Forms]![frmSurveyResponses]![sfrmResponses].[Form]![QstnID]));"
End If
If IsNull(Me![RspnsValid]) Then
Me![Rspns].ValidationRule = ""
Me![Rspns].ValidationText = ""
Else
Me![Rspns].ValidationRule = Me![RspnsValid]
Me![Rspns].ValidationText = Me![RspnsValid]
End If
' If Not IsNull(QstnMask) Then
' Me!Rspns.Visible = False
' Me!txtRspns.Visible = True
' Me![txtRspns].InputMask = QstnMask
' Else
' Me!Rspns.Visible = True
' Me!txtRspns.Visible = False
' Me![txtRspns].InputMask = ""
' End If

End Sub

If I am seeing things correctly,

If Me![RspnsType] = 1 Then
Me![Rspns].RowSourceType = "Value List"
Me![Rspns].RowSource = "Yes;No"
Else
Me![Rspns].RowSourceType = "Table/Query"
Me![Rspns].RowSource = "SELECT tblResponsesList.Rspns FROM
tblResponsesList WHERE
((tblResponsesList.QstnID=[Forms]![frmSurveyResponses]![sfrmResponses].[Form]![QstnID]));"
End If

is stating that if the field RspnsType = 1 then to have a value list. If
not, to use a Table/Query. The problem is that every field, no matter what
RspnsType is set to displays the field as a Value List.
Any suggestions?
 
O

OfficeDev18 via AccessMonster.com

What the code is addressing is the row source property for a combo box. What
Hookum is saying is that if the RspnsType is 1, the row source is a valuelist
comprised of yes (record 1) or no (record 2). If RspnsType is some other
value, the row source is a query defined by his SQL statement.

Am I making sense?

Steve said:
I have downloaded Duane Hookom's "At Your Survey" database. I have been
looking around the database, which looks really good and thorough,
I do have a question about some code on one of the forms that doesn't appear
to be doing what it should. The code in question is:

Private Sub Form_Current()
Rspns.Requery
Me![Rspns].LimitToList = Me!LmtLst
If Me![RspnsType] = 1 Then
Me![Rspns].RowSourceType = "Value List"
Me![Rspns].RowSource = "Yes;No"
Else
Me![Rspns].RowSourceType = "Table/Query"
Me![Rspns].RowSource = "SELECT tblResponsesList.Rspns FROM
tblResponsesList WHERE
((tblResponsesList.QstnID=[Forms]![frmSurveyResponses]![sfrmResponses].[Form]![QstnID]));"
End If
If IsNull(Me![RspnsValid]) Then
Me![Rspns].ValidationRule = ""
Me![Rspns].ValidationText = ""
Else
Me![Rspns].ValidationRule = Me![RspnsValid]
Me![Rspns].ValidationText = Me![RspnsValid]
End If
' If Not IsNull(QstnMask) Then
' Me!Rspns.Visible = False
' Me!txtRspns.Visible = True
' Me![txtRspns].InputMask = QstnMask
' Else
' Me!Rspns.Visible = True
' Me!txtRspns.Visible = False
' Me![txtRspns].InputMask = ""
' End If

End Sub

If I am seeing things correctly,

If Me![RspnsType] = 1 Then
Me![Rspns].RowSourceType = "Value List"
Me![Rspns].RowSource = "Yes;No"
Else
Me![Rspns].RowSourceType = "Table/Query"
Me![Rspns].RowSource = "SELECT tblResponsesList.Rspns FROM
tblResponsesList WHERE
((tblResponsesList.QstnID=[Forms]![frmSurveyResponses]![sfrmResponses].[Form]![QstnID]));"
End If

is stating that if the field RspnsType = 1 then to have a value list. If
not, to use a Table/Query. The problem is that every field, no matter what
RspnsType is set to displays the field as a Value List.
Any suggestions?
 
D

Duane Hookom

I think you are making perfect sense.

--
Duane Hookom
MS Access MVP
--

OfficeDev18 via AccessMonster.com said:
What the code is addressing is the row source property for a combo box.
What
Hookum is saying is that if the RspnsType is 1, the row source is a
valuelist
comprised of yes (record 1) or no (record 2). If RspnsType is some other
value, the row source is a query defined by his SQL statement.

Am I making sense?

Steve said:
I have downloaded Duane Hookom's "At Your Survey" database. I have been
looking around the database, which looks really good and thorough,
I do have a question about some code on one of the forms that doesn't
appear
to be doing what it should. The code in question is:

Private Sub Form_Current()
Rspns.Requery
Me![Rspns].LimitToList = Me!LmtLst
If Me![RspnsType] = 1 Then
Me![Rspns].RowSourceType = "Value List"
Me![Rspns].RowSource = "Yes;No"
Else
Me![Rspns].RowSourceType = "Table/Query"
Me![Rspns].RowSource = "SELECT tblResponsesList.Rspns FROM
tblResponsesList WHERE
((tblResponsesList.QstnID=[Forms]![frmSurveyResponses]![sfrmResponses].[Form]![QstnID]));"
End If
If IsNull(Me![RspnsValid]) Then
Me![Rspns].ValidationRule = ""
Me![Rspns].ValidationText = ""
Else
Me![Rspns].ValidationRule = Me![RspnsValid]
Me![Rspns].ValidationText = Me![RspnsValid]
End If
' If Not IsNull(QstnMask) Then
' Me!Rspns.Visible = False
' Me!txtRspns.Visible = True
' Me![txtRspns].InputMask = QstnMask
' Else
' Me!Rspns.Visible = True
' Me!txtRspns.Visible = False
' Me![txtRspns].InputMask = ""
' End If

End Sub

If I am seeing things correctly,

If Me![RspnsType] = 1 Then
Me![Rspns].RowSourceType = "Value List"
Me![Rspns].RowSource = "Yes;No"
Else
Me![Rspns].RowSourceType = "Table/Query"
Me![Rspns].RowSource = "SELECT tblResponsesList.Rspns FROM
tblResponsesList WHERE
((tblResponsesList.QstnID=[Forms]![frmSurveyResponses]![sfrmResponses].[Form]![QstnID]));"
End If

is stating that if the field RspnsType = 1 then to have a value list. If
not, to use a Table/Query. The problem is that every field, no matter
what
RspnsType is set to displays the field as a Value List.
Any suggestions?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top