Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with Filter

Status
Not open for further replies.

rry2k

Programmer
Jun 28, 2001
678
US
Hi,

I'm trying to set a filter on a subform after a click in a combobox on the parent. The filter is:
[time cards subform].Form.Filter = "[time card hours]![TimeCardID]=([forms]![Time cards]![combo15].column(1))"

The error I get is:
Undefined function ([forms]![Time cards]![combo15].column(1)) When I run this in the immediate window it displays the results fine.

I would really appreciate the help on this. Thanks..Russ
 
Try removing the parantheses from the right side of the equals sign i.e.
=[forms]![Time cards]![combo15].column(1)"

HTH,
jc

 
jc,

I tried that and got the same error so I removed the column(1) and the error went away but know I don't get the results I need. column(0) has an employee name that is displayed and colum(1) ahs the id that I need to reference.
 
Have you tried creating a variable to store the value and then using the value in the filter?
i.e.

Dim iD as Integer

iD = combo15.Column(1)

.Filter = ".... = iD"

HTH,
jc
 
Good thought. I tried
[time cards subform].Form.Filter = "[time card hours]![TimeCardID] = intcom15" and got a datatype mismatch
The variable works good but my syntax isn't. timecardid is an autonum which is long int so I defined the variable as long.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top