Undefined Function

G

Guest

I have created a form named frmcommbysource with 3 controls. First control
is a combo box named cbosource that has two fields, ID and name. The other
two controls are both date/time picker controls called dtstart and dtend
respectively. I then created the first of 3 queries used for a summary
report. Two of the fields in this query are Tour_date and name. I put the
following into the Tour_date criteria: "
Between forms!frmcommbysource.dtstart and forms!frmcommbysource.dtend. I
then created 2 parameters forms!frmcommbysource.dtstart date/time and
forms!frmcommbysource.dtend date/time. I then put a button on the form and
added the following code in the click event:
dim stDocName as string

stDocName = "qryCommissionSummary"
docmd.OpenQuery stDocName, acNormal, acEdit

When I enter the dates and push the button the query runs ok.

I then added the following to the [name] field criteria:
forms!frmcommbysource.cbosource.column(1)
-- Since column 0 is the id and column 1 is the name.
Then I added the following to the parameters:
forms!frmcommbysource.cbosource.column(1) text

when I run the frmcommbysource and pick a name from the combo, then dates
and hit the button I get the following error :
Undefined function forms!frmcommbysource.cbosource.column... in expression

I have checked for missing references and there are none.

Thanks for the help.

Ray
 
G

Guest

Wow! That has to be the fastest answer I have ever received. Worked like a
charm. Thanks for the help

Van T. Dinh said:
Try:

Eval("Forms!frmcommbysource.cbosource.Column(1)")


--
HTH
Van T. Dinh
MVP (Access)



RayH said:
I have created a form named frmcommbysource with 3 controls. First control
is a combo box named cbosource that has two fields, ID and name. The
other
two controls are both date/time picker controls called dtstart and dtend
respectively. I then created the first of 3 queries used for a summary
report. Two of the fields in this query are Tour_date and name. I put
the
following into the Tour_date criteria: "
Between forms!frmcommbysource.dtstart and forms!frmcommbysource.dtend. I
then created 2 parameters forms!frmcommbysource.dtstart date/time and
forms!frmcommbysource.dtend date/time. I then put a button on the form
and
added the following code in the click event:
dim stDocName as string

stDocName = "qryCommissionSummary"
docmd.OpenQuery stDocName, acNormal, acEdit

When I enter the dates and push the button the query runs ok.

I then added the following to the [name] field criteria:
forms!frmcommbysource.cbosource.column(1)
-- Since column 0 is the id and column 1 is the name.
Then I added the following to the parameters:
forms!frmcommbysource.cbosource.column(1) text

when I run the frmcommbysource and pick a name from the combo, then dates
and hit the button I get the following error :
Undefined function forms!frmcommbysource.cbosource.column... in expression

I have checked for missing references and there are none.

Thanks for the help.

Ray
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top