D
DawnTreader
Hello All
i am uncertain as to the best way to do this. i am creating a function to
check out the validity of something that is based on a lot of criteria. i
want to know is it better to build a record set or get the fields i need by
dlookup?
for instance this code:
strProdType = DLookup("ProductTypeID", "tblProductList", "ProductID = "
& Product_ID)
dtDateToCompare = Date
dtDateShipped = DLookup("DateShipped", "tblProductList", "ProductID = "
& Product_ID)
dtDateCommissioned = DLookup("DateCommissioned", "tblProductList",
"ProductID = " & Product_ID)
lngCommissionedMonths = DLookup("WarrantyMonths", "tblProductList",
"ProductID = " & Product_ID)
lngShippedMonths = DLookup("WarrantyShippedMonths", "tblProductList",
"ProductID = " & Product_ID)
lngHours = Nz(DLookup("WarrantyHours", "tblProductList", "ProductID = "
& Product_ID), 4000)
booExtended = DLookup("WarrantyExtended", "tblProductList", "ProductID =
" & Product_ID)
dtDateExtendedFrom = DLookup("DateWarrantyExtended", "tblProductList",
"ProductID = " & Product_ID)
lngHoursExtended = Nz(DLookup("HoursExtended", "tblProductList",
"ProductID = " & Product_ID), 1000)
lngMonthsExtended = Nz(DLookup("MonthsExtended", "tblProductList",
"ProductID = " & Product_ID), 5)
is what i was thinking of using. each of these variables will be from the
same record, so i am thinking that i need an easier way of finding these
fields and turning them in to variables. the function then takes those
variables and makes some decisions and then spits out an answer. that logic i
have all worked out, but the thing to get the necessary information to make
those decisions i wasnt sure how to get it done.
as always, any and all help appreciated.
i am uncertain as to the best way to do this. i am creating a function to
check out the validity of something that is based on a lot of criteria. i
want to know is it better to build a record set or get the fields i need by
dlookup?
for instance this code:
strProdType = DLookup("ProductTypeID", "tblProductList", "ProductID = "
& Product_ID)
dtDateToCompare = Date
dtDateShipped = DLookup("DateShipped", "tblProductList", "ProductID = "
& Product_ID)
dtDateCommissioned = DLookup("DateCommissioned", "tblProductList",
"ProductID = " & Product_ID)
lngCommissionedMonths = DLookup("WarrantyMonths", "tblProductList",
"ProductID = " & Product_ID)
lngShippedMonths = DLookup("WarrantyShippedMonths", "tblProductList",
"ProductID = " & Product_ID)
lngHours = Nz(DLookup("WarrantyHours", "tblProductList", "ProductID = "
& Product_ID), 4000)
booExtended = DLookup("WarrantyExtended", "tblProductList", "ProductID =
" & Product_ID)
dtDateExtendedFrom = DLookup("DateWarrantyExtended", "tblProductList",
"ProductID = " & Product_ID)
lngHoursExtended = Nz(DLookup("HoursExtended", "tblProductList",
"ProductID = " & Product_ID), 1000)
lngMonthsExtended = Nz(DLookup("MonthsExtended", "tblProductList",
"ProductID = " & Product_ID), 5)
is what i was thinking of using. each of these variables will be from the
same record, so i am thinking that i need an easier way of finding these
fields and turning them in to variables. the function then takes those
variables and makes some decisions and then spits out an answer. that logic i
have all worked out, but the thing to get the necessary information to make
those decisions i wasnt sure how to get it done.
as always, any and all help appreciated.