MULTIPLE FORMS

HJAMES

Registered User.
Local time
Today, 04:23
Joined
Jul 12, 2001
Messages
36
In my application I am using 3 forms. Form1 is based on 2 tables, the primary key is LAB_NO. Form2 and Form3 are both base on sub forms which display data from 4 tables based on LAB_NO. My problem is this, I want to return to Form1 on the same LAB_NO I was on when I left. Currently I am using the folowing code:
stLinkCriteria = "[LAB_NO]=" & "'" & Me![LAB_NO] & "'"

This work but set a filter, which means I can't move to next or previous record without resetting the filter. When I do it returns to record 1. I've tried several things and I can't get it to work.

Any suggestions???
 
you need to use the bookmark property

don't use a strCriteria

So
dim rst as recordset

DoCmd.Openform "form1"
set rst=forms!form1.recordsetclone
rst.findfirst "[LAB_NO]=" & "'" & Me![LAB_NO] & "'"
forms!form1.bookmark=rst.bookmark

you'll probably need to a line of code to close the current form.
 
THANK YOU SO MUCH. IT WORKS LIKE A CHAMP!
 

Users who are viewing this thread

Back
Top Bottom