Connecting Tech Pros Worldwide Forums | Help | Site Map

Bookmark problem

Kaur
Guest
 
Posts: n/a
#1: Jun 20 '06
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


salad
Guest
 
Posts: n/a
#2: Jun 21 '06

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.
Kaur
Guest
 
Posts: n/a
#3: Jun 21 '06

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]

Larry Linson
Guest
 
Posts: n/a
#4: Jun 22 '06

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


Kaur
Guest
 
Posts: n/a
#5: Jun 22 '06

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]

Larry Linson
Guest
 
Posts: n/a
#6: Jun 22 '06

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]


Closed Thread


Similar Microsoft Access / VBA bytes