Open form and go to record

  • Thread starter Thread starter julief
  • Start date Start date
J

julief

I have a form (Void details) on which I have placed a command button. On
clicking the command button I want to open another form (SOR details) but at
the same time go to the same void details. Link is job number.
I did have this form as a tab on the void details form, but it slowed things
down too much, hence the reason I have taken it off.

Any help would be most welcome.
 
There is a wizard for this. If you add a new command button to the form,
then select Form Operation, then Open From, hit next, select the form to
open, hit next, select Open the form and find specific data to display, pick
the realting fields on each side then you will get code that looks something
like this...
Private Sub YourButtonName_Click()
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "SOR details"

stLinkCriteria = "[job number]=" & Me![FieldNameThatHasJobNumber]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit Sub

Hope this helps.
 
This worked great, thanks very much

Ryan said:
There is a wizard for this. If you add a new command button to the form,
then select Form Operation, then Open From, hit next, select the form to
open, hit next, select Open the form and find specific data to display, pick
the realting fields on each side then you will get code that looks something
like this...
Private Sub YourButtonName_Click()
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "SOR details"

stLinkCriteria = "[job number]=" & Me![FieldNameThatHasJobNumber]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit Sub

Hope this helps.
--
Please remember to mark this post as answered if this solves your problem.


julief said:
I have a form (Void details) on which I have placed a command button. On
clicking the command button I want to open another form (SOR details) but at
the same time go to the same void details. Link is job number.
I did have this form as a tab on the void details form, but it slowed things
down too much, hence the reason I have taken it off.

Any help would be most welcome.
 
Back
Top