473,437 Members | 1,732 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,437 software developers and data experts.

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
From the filled listSubquestion I click on a subquestion that fills the

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

Jun 20 '06 #1
5 2440
Kaur wrote:
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
From the filled listSubquestion I click on a subquestion that fills the

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

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.
Jun 21 '06 #2
I found the solution. Please ignore this post.
salad wrote:
Kaur wrote:
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
From the filled listSubquestion I click on a subquestion that fills the

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

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.


Jun 21 '06 #3
"Kaur" <ka***@saic.com> wrote
I found the solution. Please ignore this post.


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
Jun 22 '06 #4
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:
"Kaur" <ka***@saic.com> wrote
> I found the solution. Please ignore this post.


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


Jun 22 '06 #5
Thanks.

"Kaur" <ka***@saic.com> wrote in message
news:11**********************@g10g2000cwb.googlegr oups.com...
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:
"Kaur" <ka***@saic.com> wrote
> I found the solution. Please ignore this post.


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

Jun 22 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: PeteCresswell | last post by:
I'm doing the bookmark thing to force the current record in a subform and it works....almost. Problem is that the subform then scrolls so that the newly-selected field is at the very top of the...
3
by: DrFoo | last post by:
(Access 97 and 2003) Hi, Here's a smippit of code that works correctly about 95% of the time. This part of the algorithm... - find the first value = true - if found, find next value =...
2
by: corepaul | last post by:
I am fairly new to Access and I have a problem trying to use bookmarks with a recordset. I have a recordset dimensioned as, Dim rstFoodDesc As ADODB.Recordset ' recordset Dim bMark As...
2
by: Thelma Lubkin | last post by:
With Me!PERSONSLIST.Form.RecordsetClone .FindFirst strID If .NoMatch Then Debug.Print "key " & Key & " nomatch" Exit Sub Else If Me.Dirty Then Me.Dirty = False Debug.Print "A_LOAD bookmark = "...
6
by: Chris | last post by:
I have been learning C and want to write a program and need someone to point me in the write direction. I want to write a program to store all my webpage bookmarks in possibly one file. I want it...
2
by: Alan T | last post by:
How do I make use of the Bookmarks property so that I can write a text at/below the position of a particular bookmark or the first bookmark ? private Microsoft.Office.Interop.Word.Document...
11
by: Tom Clavel | last post by:
I need to make sure that I am on a different record than I just was on, in a DAO recordset. code fragment: 1. strFind = "thisSource = " & tripID & " AND thisTrip = " & tripID 2. ...
3
by: Raistlin Majere | last post by:
Not really, but how can I protect my privacy from bookmark icon updating? Can you open the code to the author of the Stealther extension?
0
by: JosAH | last post by:
Greetings, Introduction At this moment we have a TextProcessor, a LibraryBuilder as well as the Library itself. As you read last week a Library is capable of producing pieces of text in a...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.