Q: open form filtered by several values?

  • Thread starter Thread starter Jen
  • Start date Start date
J

Jen

In a forms recordsource (which is a query) there can be many values. For
instance 4, 19 and 32. In this form I cycle through the values normally in
form view, they appear in a textbox one at a time when going right and left
klicking the arrows at the bottom.

On this form I also have a CommandButton. This button opens a second form
filtered by the value in the textbox.

Works in a way, that is, the second form opens filtered to the record that
was in the textbox on the first form when I clicked the Commandbutton.

However I need to open the second form filtered to all the records on the
first form, not only the one showing at the time of clicking the
CommandButton. That is, the second form should open filtered showing 3
records (records 4, 19 and 32) so that I could cycle through the same
records in the same way on the second form as in the first form.

The value being filtered in the second form is the second forms only unique
value coming from that forms underlying tables primary key.

No matter what I try, the second form opens filtered to one record only.

Anyone? Jen.
 
What is the code in the On Click procedure?


--
HTH,

Steve Clark, Access MVP
FMS, Inc.
Professional Solutions Group
http://www.FMSInc.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Is your Access database too slow?
Are you ready to upgrade to SQL Server?
Contact us for optimization and/or upsizing!
http://www.FMSInc.com/consulting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
Hello Steve. Behind the Commandbuttons OnClick event there is (as you can
see it's made with the vizard):

Private Sub cmd_bladdra_sena_Click()
On Error GoTo Err_cmd_bladdra_sena_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "fakturainmatning"

stLinkCriteria = "[fakturanr]=" & Me![fakturanr]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmd_bladdra_sena_Click:
Exit Sub

Err_cmd_bladdra_sena_Click:
MsgBox err.Description
Resume Exit_cmd_bladdra_sena_Click

End Sub

Jen.
 
Back
Top