Access2000: Bookmark problem

A

Arvi Laanemets

Hi

I have a single form with has a single-field table as source. On this single
form I have a continous subform based on same table, and a couple of another
continous subforms, which are linked to single-form's source. The whole
system is meant to manage some time-bound properties of some objects (the
object is used by some person from some date, the object is used in some
department from some date, etc.)

What I want, is that when I navigate on first continous subform, other
subforms must display according data - i.e. the recordset bookmark on parent
form must change accordingly to entry selected on first subform. The
procedure below (a Current event for first subform) almost does it (it
changes the active record for single (parent) form, other subforms are
synchronized automatically).

Private Sub Form_Current()

Me.Parent.RecordsetClone.FindFirst "[A-Number] = '" &
Nz(Me.A_number.Value, "") & "'"
Me.Parent.Bookmark = Me.Parent.RecordsetClone.Bookmark

End Sub


The problem is, when on first subform I select/move to 'New record' entry,
then other subforms are showing some entries, which is wrong - the other
forms must be empty instead.


Can someone here give me some help with this?
Thanks in advance!
 
P

Pieter Wijnen

A blank record has no bookmark
you must check for Rs.NoMatch & Move The Parent to a New Record if none
found

Pieter

Arvi Laanemets said:
Hi

I have a single form with has a single-field table as source. On this
single form I have a continous subform based on same table, and a couple
of another continous subforms, which are linked to single-form's source.
The whole system is meant to manage some time-bound properties of some
objects (the object is used by some person from some date, the object is
used in some department from some date, etc.)

What I want, is that when I navigate on first continous subform, other
subforms must display according data - i.e. the recordset bookmark on
parent form must change accordingly to entry selected on first subform.
The procedure below (a Current event for first subform) almost does it (it
changes the active record for single (parent) form, other subforms are
synchronized automatically).

Private Sub Form_Current()

Me.Parent.RecordsetClone.FindFirst "[A-Number] = '" &
Nz(Me.A_number.Value, "") & "'"
Me.Parent.Bookmark = Me.Parent.RecordsetClone.Bookmark

End Sub


The problem is, when on first subform I select/move to 'New record' entry,
then other subforms are showing some entries, which is wrong - the other
forms must be empty instead.


Can someone here give me some help with this?
Thanks in advance!
 
A

Arvi Laanemets

Hi


"Pieter Wijnen"
A blank record has no bookmark
you must check for Rs.NoMatch & Move The Parent to a New Record if none
found


Thanks! The code below did it!


Private Sub Form_Current()

If Nz(Me.A_number.Value, "") = "" Then
Me.Parent.Recordset.AddNew
Else
Me.Parent.RecordsetClone.FindFirst "[A-Number] = '" &
Me.A_number.Value & "'"
Me.Parent.Bookmark = Me.Parent.RecordsetClone.Bookmark
End If

End Sub
 
P

Pieter Wijnen

de nada

Pieter

Arvi Laanemets said:
Hi


"Pieter Wijnen"
A blank record has no bookmark
you must check for Rs.NoMatch & Move The Parent to a New Record if none
found


Thanks! The code below did it!


Private Sub Form_Current()

If Nz(Me.A_number.Value, "") = "" Then
Me.Parent.Recordset.AddNew
Else
Me.Parent.RecordsetClone.FindFirst "[A-Number] = '" &
Me.A_number.Value & "'"
Me.Parent.Bookmark = Me.Parent.RecordsetClone.Bookmark
End If

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top