Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open a form based on criteria set

Status
Not open for further replies.

gruff

Technical User
Oct 26, 2000
1
GB
I have a form 'b', that when the on-click event is activated I want the following to happen
a) Open another form called 'food' showing just the record(s) that form (b) shows.
The link I have between forms is a number field called 'isn'

So will the code look something like?
(I know I have the stLinkCriteria line completely wrong and this code would only open the current record shown (not all the ones the form 'b' has filtered - it may filter 1 or more)
Please help

On Error GoTo Err_Command13_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "food"

stLinkCriteria = "[isn]=" & Chr(34) & Me![isn] & Chr(34)
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormEdit
DoCmd.Maximize

Exit_Command13_Click:
Exit Sub

Err_Command13_Click:
MsgBox Err.Description
Resume Exit_Command13_Click
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top