Viewing the same record whilst switching between forms

C

Craig

I have a problem in my database, I have various forms
which all have the same Primary Key (RUN NUMBER)but
various data which needs to be viewed. I have a lot of
records in this database, currently when I 'OPEN' another
form using the Command button macro I have designed, the
form opens at record number 1.

I need to be able to switch between forms to view the
same record in each form but do not want to go to the
hassle of finding records each time I do it. Is there
something I can add to the command button 'OPEN' macro
that will open the form at the same record as that which
I have been viewing? Or am I missing something obvious.

In lotus Approach, I had the same database with switching
views and it kept the record number the same
automatically, people have already commented about the
constant need to check that they are on the correct
record.

Thanks


Craig.
 
J

Jim/Chris

Your code for your command button that opens the second
form should look similar to this.

Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "form name"
stLinkCriteria = "[Record ID]=" & "'" & Me![Record ID]
& "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria


Jim
 

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