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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Type Mismatch error

Status
Not open for further replies.

tekaccess

Programmer
Oct 24, 2006
31
CA
Hi

WHen i click on combo box to view the subform, a error message of type mismatch (error 13) comes up.
Contract_afterupdate()
if contract.column(0) then
me.subform.visible=true
elseif contract.column(1) then
me.subform1.visible=true
else
me.subform2.visible=true
endif

I am getting error message on column(0)
my combo box is value list ("one";"two";"three")
any suggestion

Thanks
 
Column property refers to the column in a multi-column combo box or listbox, not to the item selected, which I think is what you're trying to do. In a combo box with 3 columns, for instance:

Man Woman Child
Dog Cat Bird

.Column(0) would refer to Man or Dog, .Column(1) would refer to Woman or Cat, and so on. I think you mean to be using the .ListIndex property instead, where .ListIndex(0) would refer to Man and .ListIndex(1) would refer to Dog.

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
This
Code:
if contract.column(0) then
evaluates to
Code:
if "one" then
An "IF" statement expects a variable or expression that evaluates to a logical TRUE or FALSE. "One" cannot be so evaluated. Do you mean
Code:
If contract.column(0).Value = "One" then
?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top