473,785 Members | 2,167 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 sfrsfrmResponse s.
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 "lstSuquest ion" with relevant sub questions for
selected question in lstQuestion on main form. The code I am using is

Private Sub lstQuestion_Aft erUpdate()

Me![lstSubQuestion].Requery
Dim rs As Object
Set rs = Me.Recordset.Cl one
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.Cl one
rs.FindFirst "[SubQuestionID] = " & str(Me![lstSubQuestion])
Me.Bookmark = rs.Bookmark
'Reset the combo box.
Me.lstSubQuesti on = ""
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 2467
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 sfrsfrmResponse s.
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 "lstSuquest ion" with relevant sub questions for
selected question in lstQuestion on main form. The code I am using is

Private Sub lstQuestion_Aft erUpdate()

Me![lstSubQuestion].Requery
Dim rs As Object
Set rs = Me.Recordset.Cl one
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.Cl one
rs.FindFirst "[SubQuestionID] = " & str(Me![lstSubQuestion])
Me.Bookmark = rs.Bookmark
'Reset the combo box.
Me.lstSubQuesti on = ""
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 sfrsfrmResponse s.
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 "lstSuquest ion" with relevant sub questions for
selected question in lstQuestion on main form. The code I am using is

Private Sub lstQuestion_Aft erUpdate()

Me![lstSubQuestion].Requery
Dim rs As Object
Set rs = Me.Recordset.Cl one
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.Cl one
rs.FindFirst "[SubQuestionID] = " & str(Me![lstSubQuestion])
Me.Bookmark = rs.Bookmark
'Reset the combo box.
Me.lstSubQuesti on = ""
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.goo glegroups.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
2868
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 form. We don't want that. Instead, we want the from to be scrolled to the very top (there are a limited number of rows...so there's no problem with the newly-selected row being somewhere off the bottom of the form). Anybody done this?
3
2387
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 = false - if found, find next value = true
2
8610
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 Variant ' variable to store bookmark I open the recordset with the statements,
2
2588
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 = " & .Bookmark Debug.Print "A_LOAD cloneKey = " & .Fields("PrimKey") ' Me.Bookmark = .Bookmark
6
2043
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 to be a GUI. The webpage addresses will be viewed in a tree-like structure eg. Search Engines - Google - Yahoo News - BBC
2
9500
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 myWordDoc = new Document(); myWordDoc.Bookmarks
11
4283
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. rs.FindFirst (strFind) 3. If Not rs.NoMatch Then 4. strBookmark = rs.Bookmark 5. rs.MoveFirst
3
1576
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
4076
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 simple way. We also briefly mentioned the BookMark which represents a single paragraph of text. We haven't seen it's implementation yet. This is the topic of this week's article part.
0
9647
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10162
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9959
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8988
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6744
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5528
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4061
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2893
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.