Bookmark problem | | |
Hi,
I am having a strange bookmark problem. I have a main form called
frmSurveyQSubQ. This form has a subform called sfrmRespodent.
SfrmRespondent has a sfrm in it called sfrsfrmResponses.
I have a list box on main form called lstQuestion that displays all the
questions relevant to a survey. Clicking on a question in it fills the
second list box "lstSuquestion" with relevant sub questions for
selected question in lstQuestion on main form. The code I am using is
Private Sub lstQuestion_AfterUpdate()
Me![lstSubQuestion].Requery
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[QuestionID] = " & str(Me![lstQuestion])
Me.Bookmark = rs.Bookmark
'Reset the combo box.
Me.lstQuestion = ""
End Sub
[color=blue]
>From the filled listSubquestion I click on a subquestion that fills the[/color]
relevant Respondent in lstRespondent list box for selected subquestion.
Private Sub lstSubQuestion_Click()
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[SubQuestionID] = " & str(Me![lstSubQuestion])
Me.Bookmark = rs.Bookmark
'Reset the combo box.
Me.lstSubQuestion = ""
Me.cmdAddImpact.Enabled = True
End Sub
Every thing is working fine. I select Question "QuestionA", that is
associated with SubQuestion "SubQuesA", SubQuesB" etc. Selecting one of
the selected subquestion shows me the correct Respondent assocaited
with it.
The problem occurs when I select Question "QuestionB" which is also
associated with "SubQuesA", Selecting on SubquesA takes me back to
QuestionA instead of showing me associated Respondent for Question B
and SubQuestA.
In other words if a sub question is associated with more than one
question, selecting on that sub question takes me back to the
associated previously opened question not the current question for
which the sub question is selected for.
No matter how much I try I can not view Respondent associated with
QuestionB and SubQuesA. It keeps on taking me back to Question A and
sub QuestionA.
Any help would be appreciated.
MK | | | | re: Bookmark problem
Kaur wrote:
[color=blue]
> Hi,
> I am having a strange bookmark problem. I have a main form called
> frmSurveyQSubQ. This form has a subform called sfrmRespodent.
> SfrmRespondent has a sfrm in it called sfrsfrmResponses.
> I have a list box on main form called lstQuestion that displays all the
> questions relevant to a survey. Clicking on a question in it fills the
> second list box "lstSuquestion" with relevant sub questions for
> selected question in lstQuestion on main form. The code I am using is
>
> Private Sub lstQuestion_AfterUpdate()
>
> Me![lstSubQuestion].Requery
> Dim rs As Object
> Set rs = Me.Recordset.Clone
> rs.FindFirst "[QuestionID] = " & str(Me![lstQuestion])
> Me.Bookmark = rs.Bookmark
> 'Reset the combo box.
> Me.lstQuestion = ""
> End Sub
>[color=green]
>>From the filled listSubquestion I click on a subquestion that fills the[/color]
> relevant Respondent in lstRespondent list box for selected subquestion.
>
> Private Sub lstSubQuestion_Click()
> Dim rs As Object
>
> Set rs = Me.Recordset.Clone
> rs.FindFirst "[SubQuestionID] = " & str(Me![lstSubQuestion])
> Me.Bookmark = rs.Bookmark
> 'Reset the combo box.
> Me.lstSubQuestion = ""
> Me.cmdAddImpact.Enabled = True
> End Sub
>
> Every thing is working fine. I select Question "QuestionA", that is
> associated with SubQuestion "SubQuesA", SubQuesB" etc. Selecting one of
> the selected subquestion shows me the correct Respondent assocaited
> with it.
>
> The problem occurs when I select Question "QuestionB" which is also
> associated with "SubQuesA", Selecting on SubquesA takes me back to
> QuestionA instead of showing me associated Respondent for Question B
> and SubQuestA.
> In other words if a sub question is associated with more than one
> question, selecting on that sub question takes me back to the
> associated previously opened question not the current question for
> which the sub question is selected for.
>
> No matter how much I try I can not view Respondent associated with
> QuestionB and SubQuesA. It keeps on taking me back to Question A and
> sub QuestionA.
>
> Any help would be appreciated.
>
> MK
>[/color]
I'll toss this out.
Just before each
rs.FindFirst
enter something like
msgbox str(Me![lstSubQuestion]
Maybe the values aren't what you expect, not getting updated.
Next, set some breakpoints in your code. Then follow the bouncing code. | | | | re: Bookmark problem
I found the solution. Please ignore this post.
salad wrote:[color=blue]
> Kaur wrote:
>[color=green]
> > Hi,
> > I am having a strange bookmark problem. I have a main form called
> > frmSurveyQSubQ. This form has a subform called sfrmRespodent.
> > SfrmRespondent has a sfrm in it called sfrsfrmResponses.
> > I have a list box on main form called lstQuestion that displays all the
> > questions relevant to a survey. Clicking on a question in it fills the
> > second list box "lstSuquestion" with relevant sub questions for
> > selected question in lstQuestion on main form. The code I am using is
> >
> > Private Sub lstQuestion_AfterUpdate()
> >
> > Me![lstSubQuestion].Requery
> > Dim rs As Object
> > Set rs = Me.Recordset.Clone
> > rs.FindFirst "[QuestionID] = " & str(Me![lstQuestion])
> > Me.Bookmark = rs.Bookmark
> > 'Reset the combo box.
> > Me.lstQuestion = ""
> > End Sub
> >[color=darkred]
> >>From the filled listSubquestion I click on a subquestion that fills the[/color]
> > relevant Respondent in lstRespondent list box for selected subquestion.
> >
> > Private Sub lstSubQuestion_Click()
> > Dim rs As Object
> >
> > Set rs = Me.Recordset.Clone
> > rs.FindFirst "[SubQuestionID] = " & str(Me![lstSubQuestion])
> > Me.Bookmark = rs.Bookmark
> > 'Reset the combo box.
> > Me.lstSubQuestion = ""
> > Me.cmdAddImpact.Enabled = True
> > End Sub
> >
> > Every thing is working fine. I select Question "QuestionA", that is
> > associated with SubQuestion "SubQuesA", SubQuesB" etc. Selecting one of
> > the selected subquestion shows me the correct Respondent assocaited
> > with it.
> >
> > The problem occurs when I select Question "QuestionB" which is also
> > associated with "SubQuesA", Selecting on SubquesA takes me back to
> > QuestionA instead of showing me associated Respondent for Question B
> > and SubQuestA.
> > In other words if a sub question is associated with more than one
> > question, selecting on that sub question takes me back to the
> > associated previously opened question not the current question for
> > which the sub question is selected for.
> >
> > No matter how much I try I can not view Respondent associated with
> > QuestionB and SubQuesA. It keeps on taking me back to Question A and
> > sub QuestionA.
> >
> > Any help would be appreciated.
> >
> > MK
> >[/color]
> I'll toss this out.
> Just before each
> rs.FindFirst
> enter something like
> msgbox str(Me![lstSubQuestion]
>
> Maybe the values aren't what you expect, not getting updated.
>
>
> Next, set some breakpoints in your code. Then follow the bouncing code.[/color] | | | | re: Bookmark problem
"Kaur" <kaurm@saic.com> wrote
[color=blue]
> I found the solution. Please ignore this post.[/color]
Because newsgroups are for everyone's learning experience, perhaps you would
share with us what you found -- how you solved the problem.
Larry Linson
Microsoft Access MVP | | | | re: Bookmark problem
Yes certainly, My problem was the compound key. I was referring to find
records matching the current SubquestionID instead of current
QuestionID and SubQuestionID together. Including SuquestionID solved
the problem.
Larry Linson wrote:[color=blue]
> "Kaur" <kaurm@saic.com> wrote
>[color=green]
> > I found the solution. Please ignore this post.[/color]
>
> Because newsgroups are for everyone's learning experience, perhaps you would
> share with us what you found -- how you solved the problem.
>
> Larry Linson
> Microsoft Access MVP[/color] | | | | re: Bookmark problem
Thanks.
"Kaur" <kaurm@saic.com> wrote in message
news:1150985198.609121.230640@g10g2000cwb.googlegr oups.com...[color=blue]
> Yes certainly, My problem was the compound key. I was referring to find
> records matching the current SubquestionID instead of current
> QuestionID and SubQuestionID together. Including SuquestionID solved
> the problem.
> Larry Linson wrote:[color=green]
>> "Kaur" <kaurm@saic.com> wrote
>>[color=darkred]
>> > I found the solution. Please ignore this post.[/color]
>>
>> Because newsgroups are for everyone's learning experience, perhaps you
>> would
>> share with us what you found -- how you solved the problem.
>>
>> Larry Linson
>> Microsoft Access MVP[/color]
>[/color] |  | Similar Microsoft Access / VBA bytes | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,449 network members.
|