By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,940 Members | 614 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,940 IT Pros & Developers. It's quick & easy.

TreeView problem with subforms in Access97

P: n/a
Hi,
i have a problem with a treeview and some subforms in MS Access97.

I have a form with a treeview on the left side which lets me navigate
thru some projects. Then on the right side, i have several Tabs, each
with a subform.

Now, my tree view nodclick code goes like:

sProjNum = me.tvwX.SelectedItem.Key
Me.recordsetclone.findfirst "{ProjectNumber] = '" & sProjNum & "'"
me.bookmark = me.recordsetclone.bookmark

then, the current record updates (the first tab has Project Info), but
the subforms lag. Then when i click another node, the subforms update
to the _previous_ project record. So, it looks like the subforms lag
by one step.

If i click twice on teh same node, i get the response that i want.

I tried putting in code like

Me.sfrmIssues.Requery
Me.sfrmStatus.Requery
Me.refresh

but it doesn't make a difference.

help?

thx
-goro-
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
First, it seems that you can simply do
Me.recordset.findfirst "{ProjectNumber] = '" & sProjNum & "'"
and do away with bookmarks.
Secondly, are you sure that requery for subforms doesn't work? Did you
put it in after the current record is set for main form? How are
subforms linked to the main form? Have you tried manual requeries?
If nothing else, you can set recordset properties of subforms in the
same code, but that seems to be a great overkill to me.

Pavel

Evil wrote:

Hi,
i have a problem with a treeview and some subforms in MS Access97.

I have a form with a treeview on the left side which lets me navigate
thru some projects. Then on the right side, i have several Tabs, each
with a subform.

Now, my tree view nodclick code goes like:

sProjNum = me.tvwX.SelectedItem.Key
Me.recordsetclone.findfirst "{ProjectNumber] = '" & sProjNum & "'"
me.bookmark = me.recordsetclone.bookmark

then, the current record updates (the first tab has Project Info), but
the subforms lag. Then when i click another node, the subforms update
to the _previous_ project record. So, it looks like the subforms lag
by one step.

If i click twice on teh same node, i get the response that i want.

I tried putting in code like

Me.sfrmIssues.Requery
Me.sfrmStatus.Requery
Me.refresh

but it doesn't make a difference.

help?

thx
-goro-

Nov 12 '05 #2

P: n/a
Pavel Romashkin <pa*************@hotmail.com> wrote in message news:<3F***************@hotmail.com>...
First, it seems that you can simply do
Me.recordset.findfirst "{ProjectNumber] = '" & sProjNum & "'"
and do away with bookmarks.
Secondly, are you sure that requery for subforms doesn't work? Did you
put it in after the current record is set for main form? How are
subforms linked to the main form? Have you tried manual requeries?
If nothing else, you can set recordset properties of subforms in the
same code, but that seems to be a great overkill to me.

Pavel


The subforms are linked by a ProjectNumber field (which is a
textfield) and the requeries are done after the current record is
updated.

the code snippet looks like:
---
Me.RecordsetClone.FindFirst "[Project Number] = '" & sProjNum & "'"
Me.Bookmark = Me.RecordsetClone.Bookmark

Me.sfrmCompletion.Requery
Me.sfrmIssues.Requery
Me.sfrmStatus.Requery
Me.sfrmDocuments.Requery
Me.Refresh
--

strange, but i have put a combobox on the same page. The after_update
event for the combobox is simply:

Me.RecordsetClone.FindFirst "[Project Number] = '" &
Me.cboMyProjectNums & "'"
Me.Bookmark = Me.RecordsetClone.Bookmark

and it works the way i want it to.

btw, what's "manual requery". I'll try that.
Nov 12 '05 #3

P: n/a
The requery issue is very bizarre. Can you temporarily put the DB on the
web, is it very large?

Pavel

Evil wrote:

Pavel Romashkin <pa*************@hotmail.com> wrote in message news:<3F***************@hotmail.com>...
First, it seems that you can simply do
Me.recordset.findfirst "{ProjectNumber] = '" & sProjNum & "'"
and do away with bookmarks.
Secondly, are you sure that requery for subforms doesn't work? Did you
put it in after the current record is set for main form? How are
subforms linked to the main form? Have you tried manual requeries?
If nothing else, you can set recordset properties of subforms in the
same code, but that seems to be a great overkill to me.

Pavel


The subforms are linked by a ProjectNumber field (which is a
textfield) and the requeries are done after the current record is
updated.

the code snippet looks like:
---
Me.RecordsetClone.FindFirst "[Project Number] = '" & sProjNum & "'"
Me.Bookmark = Me.RecordsetClone.Bookmark

Me.sfrmCompletion.Requery
Me.sfrmIssues.Requery
Me.sfrmStatus.Requery
Me.sfrmDocuments.Requery
Me.Refresh
--

strange, but i have put a combobox on the same page. The after_update
event for the combobox is simply:

Me.RecordsetClone.FindFirst "[Project Number] = '" &
Me.cboMyProjectNums & "'"
Me.Bookmark = Me.RecordsetClone.Bookmark

and it works the way i want it to.

btw, what's "manual requery". I'll try that.

Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.