G
Guest
I've been staring at this problem for hours - it's time to call in the
reinforcements!
My form is continuous and is based on a query of Supply Items. I want to
include an indicator for each record that shows with or not this same Supply
Item exists in another table.
I put the indicator in the rowsource query and wrote a function to value it.
The function requires three input values, one of which is not available in
the query - so I made that one a Parameter.
I have this code to value the parameter:
dim db as DAO.Database, qdfSource as DAO.QueryDef
set db = CurrentDb
set qdfSource = db.QueryDefs(me.RecordSource)
qdfSource.Parameters(0) = 4 ' the 4 will be a control value
later
and I put the code in the Current event for the form.
The code sort of works but mostly doesn't - my parameter of 4 is valued but
then it seems that the query is executing multiple times and the parameter
isn't always there (it keeps getting requested of the user).
I know I don't have the event right - and I'm confused about whether or not
the querydef and db objects should be closed. There is definitely something
fundamental that I am not getting.
Any thoughts?
reinforcements!
My form is continuous and is based on a query of Supply Items. I want to
include an indicator for each record that shows with or not this same Supply
Item exists in another table.
I put the indicator in the rowsource query and wrote a function to value it.
The function requires three input values, one of which is not available in
the query - so I made that one a Parameter.
I have this code to value the parameter:
dim db as DAO.Database, qdfSource as DAO.QueryDef
set db = CurrentDb
set qdfSource = db.QueryDefs(me.RecordSource)
qdfSource.Parameters(0) = 4 ' the 4 will be a control value
later
and I put the code in the Current event for the form.
The code sort of works but mostly doesn't - my parameter of 4 is valued but
then it seems that the query is executing multiple times and the parameter
isn't always there (it keeps getting requested of the user).
I know I don't have the event right - and I'm confused about whether or not
the querydef and db objects should be closed. There is definitely something
fundamental that I am not getting.
Any thoughts?