using form fields in a function

M

Maggie

How do I refer to form fields in ADP query fucntion? I need to do this in
order to make a report run because it's based off of input a user would input
into another form. If this is not possible, I will stop trying. thanks -
 
J

Jeff L

In the function, find the field that you want to have refer to the
form. It looks like you are using a date range, so your criteria would
be: BETWEEN @BeginDate And @EndDate. Now in your report, you should
have your function as your Data Source. On the Data Tab in Properties
of the report, there is a box labeled Input Parameters. Type the
following in there:
@BeginDate = [Forms]![Report Date Range]![Beginning Log Date], @EndDate
= [Forms]![Report Date Range]![Ending Log Date]
Your Report Date Range form must be open for this to work properly,
otherwise you will be prompted for the values each time you run the
report. Hope that helps!
 
M

Maggie

I must be a total ditz. I made the changes you suggested and i get prompted
once, but now i get no data. I'll still keep trying even if it kills me.
Thanks so much for your help. I really appreciated it!!
 
M

Maggie

I have a question. In the Report Date Range form ( where the dates are
entered first ) , there's a line of code : me.caption = me.openargs. it says
it's NULL. what exactly is this supposed to do? Could this be part of the
problem I am having?
 
M

Maggie

well, Hells Bells.. It finally worked. I had the name of the query input the
same as the form input. I thought maybe it was confusing, so i changed my
query names and it worked. i didnt know that would be a problem. Oh man.. I
won't forget this one. Thanks Jeff.
 
Top