linking forms

shrive22

Board Regular
Joined
Jun 10, 2002
Messages
120
I have an initial form that only shows the user a few fields then lets them select the record they want to update, then it opens up my second form with all of the fields. How can I get the second form to open up directly to the record that was selected from the first form??

thanks for the help
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Look up the ApplyFilter method in Help.

So you would open your 2nd form from the first - something like:
Code:
Docmd.OpenForm "frmMyForm"
Me.Visible = False
Then, in the 2nd form, in the Open event, put something like
Code:
DoCmd.ApplyFilter , "[fldOne] = '" & Forms!frmOne!txtOne & "' AND [fldTwo] = " _
    & Forms!frmOne!txtTwo & " AND [fldThree] = '" & Forms!frmOne!txtThree & "'"
Where fldOne and fldThree are text fields and fldTwo is a numeric field. You just hide your original form, then build a WHERE clause (used in ApplyFilter) to filter your main form.

HTH,

Russell
 
Upvote 0

Forum statistics

Threads
1,221,532
Messages
6,160,381
Members
451,643
Latest member
nachohoyu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top