Open form at particular record on click of button

C

Courtney G

Hello.

I'm working on a mini-version of a larger form and I want the mini version
to have a button that one could click to open the larger form - at the same
record being viewed at the time. Does anyone have any suggestions for me?

the corresponding primary key is ProjectID
the mini-version of the form is sbfrm_EnquiryProjects
the larger form is frm_Projects

Thanks in advance!

Courtney
 
G

golfinray

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "07-09 Master new2"
stLinkCriteria = "[final Project ID#]=" & "'" & Me![New Project ID#] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Put this code in the onclick event of the command button. This is a sample
from my database, so change the names to your needs. The stdocname is the
name of the form you want opened. The finalproject id is the name of the
field you want to connect to in the form you are in. The New project ID is
the name of the field you want to connect to in the form you want to open.
 

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