Try and change the UniqueRecords property of the query to true
> > Try this
> >
[quoted text clipped - 18 lines]
> Thanks
> DS
DS - 25 Jul 2005 01:31 GMT
> Try and change the UniqueRecords property of the query to true
>
[quoted text clipped - 20 lines]
>>Thanks
>>DS
That didn't work. I ended up using Tinas suggestion. Thank you for
your help! As always, much appreciated.
DS
> I think he problem is with the Query itself. When I go to the Query,
> and have no records, the Query shows nothing. The Queries that work on
> the subForm show a record line even if there are no records. How can
> this be corrected.
> Thanks
> DS
well, the query itself *may not* be wrong. it sounds like you are working
with a "non-updateable" query. if it's written correctly, and is returning
the dataset you need, and if you do *not* need to be able to add/edit/delete
records in the dataset, then the query is fine.
forcing the unbound control in the subform to show a zero (0) when the query
does not return any records - that just takes a little more work. try this:
in the form's design view, go to the unbound control (i'll call it
txtTotal), and delete the expression from the ControlSource property,
leaving that line in the Properties box empty or blank.
add the following procedure to the form's Open event, as
Private Sub Form_Open(Cancel As Integer)
If Me.Recordset.RecordCount = 0 Then
Me!txtTotals = 0
Else
Me!txtTotals.ControlSource = "=Nz(Sum([TotwTax]),0)"
End If
End Sub
just change the name "txtTotals" to the name of your unbound control. if you
don't know how to add a VBA procedure to a form, post back and i'll give you
instructions - it's not hard to do.
hth
DS - 24 Jul 2005 22:22 GMT
>>I think he problem is with the Query itself. When I go to the Query,
>>and have no records, the Query shows nothing. The Queries that work on
[quoted text clipped - 32 lines]
>
> hth
Tina,
That was pretty slick! It worked great!
Thanks
DS
tina - 25 Jul 2005 02:52 GMT
you're welcome! :)
> Tina,
> That was pretty slick! It worked great!
> Thanks
> DS