Referring to Columns in a combo box ?

Ethereal

Warcraft III Player
Local time
Today, 07:07
Joined
Jan 17, 2006
Messages
99
Hello, I am using an IIF statement in my SQL criteria, and was wondering "if" it was still possible to reference a column within a combo box... here is one iif statement

Like IIf(IsNull([Forms]![fSampleSearch]![cboCustomerName]),"*",[Forms]![fSampleSearch]![cboCustomerName])

I want to refer to the third column of cboCustomerName... How would I do this ?
 
[Forms]![fSampleSearch]![cboCustomerName].Column(2)

that should do it

The first column is always zero

Hope that helps
 
IIf(IsNull([Forms]![fSampleSearch]![cboCustomerName].column(3)),"*",[Forms]![fSampleSearch]![cboCustomerName].column(3))
brings up "undefined function error" so i'm worried that i just have a simple syntax error :( (Its the 4th column that i want)
 
Last edited:
Instead of checking for null, try checking for an empty string:

Code:
IIf([Forms]![fSampleSearch]![cboCustomerName].column(3)="","*",[Forms]![fSampleSearch]![cboCustomerName].column(3))

If you are using this as a control source for a textbox or something, don't forget to put an equals sign in front

Let me know,

Scott
 
Well i still need to check for null in the case of the user not clicking on the combo box yet
 
I don't think you can refer to anything other than the bound column directly in sql
 
ok, I guess I'll just do it in the module :(
 
yes I am familliar with the column system in Access: My example i was referring to the 4th column. The reason i wanted to do it with other columns was that i needed to referr to data not located on the form anywhere else, and didn't want to make a hidden field just because it looks messy imo. But thanks for all your help everyone
 
Last edited:

Users who are viewing this thread

Back
Top Bottom