Re: null recordset

Tech-Archive recommends: Fix windows errors by optimizing your registry



you need to specify which client in the criteria clause of the DCount
function.

Brian


"richard harris" <richardharris@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:00FF7BFC-EF5E-45C1-B493-FC9E089A4B88@xxxxxxxxxxxxxxxx
> hi, i tried this and it worked whilst i only had one client in the
database,
> but as soon as i had more than one client (as there would be products for
> this client in the underlying query) it did not work.
>
> how would i apply a filter on the onload event of the edit products form,
so
> if there are no products for that specific client then the code would
work.
>
> thanks in advance. richard
>
> "Al Camp" wrote:
>
> > Richard,
> > I'd suggest not allowing the ViewProducts button to be enabled until
> > there are records to View. Better to prevent an error than code to
recover
> > from one.
> > Try a DSum on the OnCurrent event of the form to Enable or Disable
the
> > View button.
> > Something like...
> > If DCount( of your records) < 1 or IsNull(DCount( the same)) Then
> > cmdView.Enabled = True
> > Else
> > cmdView.Enabled = False
> > End If
> > Didn't test, but that should do it.
> > --
> > hth
> > Al Camp
> > Candia Computer Consulting - Candia NH
> > http://home.comcast.net/~cccsolutions
> >
> > "richard harris" <richardharris@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message
> > news:D4DFA71D-E19D-49FA-B854-063083E0D62B@xxxxxxxxxxxxxxxx
> > >i have a command that opens a form which shows all products for a
> > >particular
> > > client. what i want to achieve is to set an error message when the
view
> > > products button is clicked and there are no products in the form.
(the
> > > user
> > > adds the products and then these can be viewed and edited, a different
cmd
> > > button is used for adding products).
> > >
> > > can anyone help.
> > >
> > > thanks
> > >
> > > richard
> >
> >
> >


.


Quantcast