RE: Filter a form

Tech-Archive recommends: Speed Up your PC by fixing your registry



Hi, Cleblanc.

Please post the following properties of the frmOver18 and fromUnder18 forms"
- RecordSource
- AllowEdits
- AllowAdditions

If the RecordSource is a query, please open the query, select View, SQL, and
cut and paste the SQL.

Sprinks0

"Cleblanc" wrote:

> Now it won't let me edit the fields in either frmOver18 or frmUnder18.
>
> "Sprinks" wrote:
>
> > Hi, Cleblanc.
> >
> > You need to use the WHERE parameter with the OpenForm method.
> >
> > In the DOB AfterUpdate event procedure:
> >
> > Dim stDocName As String
> > Dim stLinkCriteria As String
> >
> > If DateValue(DatePart("m", [DOB]) & "/" & DatePart("d", [DOB]) & "/" & _
> > DatePart("yyyy", [DOB]) + 18) <= Now() Then
> >
> > stDocName = "frmOVER18"
> > Else
> > stDocName = "frmUNDER18"
> > End If
> >
> > stLinkCriteria = "[ID]=" & Me![Control On Current Form Bound to ID]
> > DoCmd.OpenForm stDocName, , , stLinkCriteria
> >
> > Hope that helps.
> > Sprinks
> >
> > "Cleblanc" wrote:
> >
> > > I have a table that has the following fields among others, ID, DOB, OVER18,
> > > UNDER18.
> > >
> > > Three forms pull from this table, frmFAMMEM, frmOVER18, frmlUNDER18.
> > >
> > > In frmFAMMEM, after the DOB is entered, a macro opens either frmOVER18 or
> > > frmUNDER18. However, when this second form opens, it always displays the
> > > first record in tblFAMMEM, not the corresponding record.
> > >
> > > Any ideas?
.



Relevant Pages

  • Re: Selecting certain items for a report
    ... recordsource for your report. ... it works well especially when the recordsource for the report is a complex ... Create a new query that only pulls data from the product form - you ... Dim StrWhere As String ...
    (microsoft.public.access.forms)
  • Re: Is it possible to show both "Yes" and "No" answers from a "yes/no"
    ... QryJobs as its recordsource. ... that query cannot be run by two separate objects. ... One workaround would be to use a different query for the report. ... Dim strRecordSource As String, strFormFilter As String ...
    (microsoft.public.access.gettingstarted)
  • Re: parameter query
    ... You can use a list box with multiple selections possible, ... over its Selected items collection to get make the said string. ... then you can write your query with the syntax: ... DoCmd, or as RecordSource of another form/report), with the implied form ...
    (microsoft.public.access.queries)
  • Re: RowSource in VBA
    ... I can see how it will work to base the report's RecordSource on the query ... and pull the SQL from the query for the RowSource of the combo box. ... >>Dim strSelect as String ...
    (microsoft.public.access.modulesdaovba)
  • Re: Missing Records in Form View
    ... Multi tables means Query/SQL String in term of Form's RecordSource. ... Open the Properties window of the Form. ... a Query grid will appear with the SQL String already parsed. ...
    (microsoft.public.access.forms)