Using command button to pull up form

  • Thread starter sarchie via AccessMonster.com
  • Start date
S

sarchie via AccessMonster.com

I would like to have a command button pull up a form that is linked to the
main form. The main form displays milestones and I would like to command
button to pull the progress notes form with the record that is linked to the
corresponding milestone.

The expression that I have tried (which I know is wrong) is:

[tblMilestonemthprgntes]![strID]=[tblMlestnes]![Progress Notes]

I would like to eliminate the user's need to enter a parameter value to pull
the corresponding progress note record.

I was going to have a subform inserted on the main form but I was having a
hard time linking the information and also the progress notes has the twelve
months which was not displaying nicely on the form.
 
L

Linq Adams via AccessMonster.com

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Your2ndFormName"

stLinkCriteria = "[strID]=" & "'" & Me![MainID] & "'"

DoCmd.OpenForm stDocName, , , stLinkCriteria

Where MainID is the field on your original form holding the id'ing data
and strID is the field in the field in the second form holding (hopefully)
the same data! Probably a more elegant way to do this, but I think this'll do!
 

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