coding a form with dynamic record counts

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dave B.

    #1

    coding a form with dynamic record counts

    I'm not sure if my title is correct, but here's what I'm trying to do:

    I have a form that displays the current number of patients and the total
    number of tickets for that patient population as a DLookup to a couple of
    text boxes. This information stays static. I have a few filters (on both
    patients & tickets) available allowing the user to select a date range and
    also patient sub-groups. What I would like to do is have a couple of new
    text boxes (under the ones indicated above) that reflects the number of
    available patients and tickets based on the current status of the filters. I
    would like these to respond as changes are made.

    How would I go about doing this? I assume you would use an event handler
    (OnChange, OnUpdate, etc.) or to you 'refresh' the form by manipulating the
    timer?

    I'm using Access 2K.

    Thanks!

    Dave
  • PC Datasheet

    #2
    Re: coding a form with dynamic record counts

    Dave,

    Put this code after the code where ever you apply your filters:
    Dim Rst As DAO.Recordset
    Set Rst = Me.RecordsetClo ne
    If Rst <> 0 Then
    Rst.MoveLast
    End If
    Me!NameOfTextBo x = Rst.RecordCount
    Rst.Close
    Set Rst = Nothing


    PS Thanks for everything you army guys do for us!!


    --
    PC Datasheet
    Your Resource For Help With Access, Excel And Word Applications



    "Dave B." <david.bretzke@ amedd.army.mil> wrote in message
    news:3bfc6b39.0 310140720.1e124 66d@posting.goo gle.com...[color=blue]
    > I'm not sure if my title is correct, but here's what I'm trying to do:
    >
    > I have a form that displays the current number of patients and the total
    > number of tickets for that patient population as a DLookup to a couple of
    > text boxes. This information stays static. I have a few filters (on both
    > patients & tickets) available allowing the user to select a date range and
    > also patient sub-groups. What I would like to do is have a couple of new
    > text boxes (under the ones indicated above) that reflects the number of
    > available patients and tickets based on the current status of the filters. I
    > would like these to respond as changes are made.
    >
    > How would I go about doing this? I assume you would use an event handler
    > (OnChange, OnUpdate, etc.) or to you 'refresh' the form by manipulating the
    > timer?
    >
    > I'm using Access 2K.
    >
    > Thanks!
    >
    > Dave[/color]


    Comment

    Working...