Go To

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have a continuous form that gives a summary of each record and then the
user cicks whichever one they want and the normal single form viewopens up
for
that record. Works fine but my boss wants to be able to scroll through the
other records (that came up on the continuous form) from within the editing
screen.

From what I understand GoTo works off an offset which is related to the
record position in a recordset. Is there a way I can get that offset value
from the record on the list view so I can jump to that record on the single
form view?

Cheers

Nick
 
It is a bit more tricky what you ask.

No doubt, your one button click code to open up the form with "details" to
edit the one record looks like:

docmd.OpenForm "EditStuff",,,"id = " & me.id

The above code behind the button will bring up the form with ONE record.
(but, of couse with only one reocrd..no navagation)

Now, you want to launch the form, send the form to the ONE record,but allow
navigation in this form. You can change the above to:

docmd.OpenForm "EditStuff"

' the above open the form, but opens all records...so, lets just "move" the
form to the id

forms!EditStuff.RecordSetClone.FindFirst "id = " & me.id
forms!EditStuff.BookMark = forms!EditStuff.RecordSetClone.BookMark

So, that one line of original code now becomes 3 lines of code, and
navigation will be allowed. In summary, we get:

docmd.OpenForm "EditStuff"
forms!EditStuff.RecordSetClone.FindFirst "id = " & me.id
forms!EditStuff.BookMark = forms!EditStuff.RecordSetClone.BookMark
 
Hey there Albert

thanks, that works fine. Too fine =)

When the single view opens I can look at ALL the records. Is there any
dynamic way of limiting the recordset to the same as the list view WITHOUT
changing the query that the form is based on? The form is accessed from about
six different places.

Thanks
 
When the single view opens I can look at ALL the records. Is there any
dynamic way of limiting the recordset to the same as the list view WITHOUT
changing the query that the form is based on? The form is accessed from
about
six different places.

Sure...if I understand your correctly....

However, the next question would be how is the "list" or so called continues
form being filtered...or set?

(you can most certainly transfer the current filter of the continues form to
the detail form that displays the one record..but allows navigation.).

So, just open up he form...and then set the filter to whatever the filter is
of the continuous form....we get:


docmd.OpenForm "EditStuff"
forms!EditStuff.Filter = me.Filter
forms!EditStuff.FilterOn = true

forms!EditStuff.RecordSetClone.FindFirst "id = " & me.id
forms!EditStuff.BookMark = forms!EditStuff.RecordSetClone.BookMark
 
Back
Top