A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Using a datasheet subform as record selector



 
 
Thread Tools Display Modes
  #1  
Old April 15th, 2010, 07:59 AM posted to microsoft.public.access.forms
Tokyo Alex
external usenet poster
 
Posts: 34
Default Using a datasheet subform as record selector

Dear all,

I have an unlinked datasheet subform which I'm using as a quick view list /
record selector for the main (detail) form. Basically I'm trying to
duplicate split form functionality, but I can't use a split form because it
destorys my formatting.

So far I have the following code:
In the subform:
With Me.Parent.RecordsetClone
.FindFirst ("daID = " & Me.daID)
If Not .NoMatch Then
Me.Parent.Recordset.Bookmark = .Bookmark
End If
End With

In the mainform:
With Me.sfcAlertSplit.Form.RecordsetClone
.FindFirst ("daID = " & Me.daID)
If Not .NoMatch Then
Me.sfcAlertSplit.Form.Recordset.Bookmark = .Bookmark
End If
End With

This works well most of the time, but it sometimes (for no reason I can
determine) gets into a fail state where it won't navigate properly.

Here's what I've figured out so far:
It won't enter the fail state if navigating in the main form.
It won't enter the fail state if I click on the datasheet's record selector.
It will enter the fail state unpredictably if I click a control in the
subform.
It will come out of the fail state if I click on the datasheet's record
selector.
It will occasionally come out of the fail state if I click a control in the
subform.
It will not come out of the fail state if I use the main form's navigation
buttons, nor will it navigate to the next record.

I put msgboxes into the procedures to test the firing order and which ID is
passed; and these are the results:
T is the target record ID and S is the source (i.e. current before
navigation) ID.
In normal state:
Main form navigation: Main (T) - Sub (T)
Subform navigation: Sub (T) - Main (T)

In fail state:
Mainform navigation: Main (T) - Sub (T) - Sub (S) - Main (S)
Subform navigation: Sub (T) - Sub (S) - Main (T) - Sub (T) - Sub (S) -
Main (S)

What is causing the subform's Current event to fire twice? And with the old
(no longer current) record ID the second time? Do you think that this is a
timing issue?

There's no other code in the subform; the main form has an unrelated command
button with a short procedure.

The main form does contain another, linked subform which does not have an On
Current event.

Any assistance, ideas, pointers or comments will be very much appreciated.

Thank you,
Alex.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:31 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.