B
BruceM
I have a vendor database (Access 2000) in which some of the vendors are
categorized as Approved. A Boolean field (Approved) in the Vendor table
defines this. If I am building an Approved Vendor form, I can either base
it on a query that uses True as the criteria for the Approved field (i.e.
the query contains only Approved vendors), or I can use something like this
in the form's Load event (I don't know if it is the correct event, but it
works):
Me.RecordSource = "SELECT * FROM tblVendor WHERE Approved = True ORDER BY
VendorName"
In the second case the main table (all vendors) is the form's record source.
Perhaps if I used a different event to define the RecordSource I wouldn't
need to name the form's Record Source on the property sheet, but I don't
really know how that works. I do know that I like to see the Record Source
on the property sheet rather than hunting through the code for it.
Also, the form's property sheet has an Order By and Filter property, but I
find these somewhat troublesome. I can't figure out how to use the Filter
property, and the form seems to drop the Order By property from time to
time, especially when switching from Form view to Design view.
I can also use the SELECT statement as the form's Record Source.
Is one approach preferable to the other, or this another case of Microsoft
providing a lot of different ways to do the same thing?
categorized as Approved. A Boolean field (Approved) in the Vendor table
defines this. If I am building an Approved Vendor form, I can either base
it on a query that uses True as the criteria for the Approved field (i.e.
the query contains only Approved vendors), or I can use something like this
in the form's Load event (I don't know if it is the correct event, but it
works):
Me.RecordSource = "SELECT * FROM tblVendor WHERE Approved = True ORDER BY
VendorName"
In the second case the main table (all vendors) is the form's record source.
Perhaps if I used a different event to define the RecordSource I wouldn't
need to name the form's Record Source on the property sheet, but I don't
really know how that works. I do know that I like to see the Record Source
on the property sheet rather than hunting through the code for it.
Also, the form's property sheet has an Order By and Filter property, but I
find these somewhat troublesome. I can't figure out how to use the Filter
property, and the form seems to drop the Order By property from time to
time, especially when switching from Form view to Design view.
I can also use the SELECT statement as the form's Record Source.
Is one approach preferable to the other, or this another case of Microsoft
providing a lot of different ways to do the same thing?