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

Data Combo Object

Status
Not open for further replies.

Collin79

Programmer
Dec 31, 2000
31
0
0
MX
Hi!!

I'm using a Data Combo object with this code:

Private Sub DataCombo1_LostFocus()

If DataCombo1.BoundText = "GNP" Then
DataCombo1.DataMember = rpGNP
DataCombo1.DataField = Company
ElseIf DataCombo1.BoundText = "SCA" Then
DataCombo1.DataMember = rpSCA
DataCombo1.DataField = Company
ElseIf DataCombo1.BoundText <> &quot;GNP&quot; And DataCombo1.BoundText <> &quot;SCA&quot; Then
DataCombo1.DataMember = rpOthers
DataCombo1.DataField = Company
End If

When I run my program and select a choice from it, i got this message error:

Compile error:

type mismatch

over this sentence:

DataCombo1.DataMember

Somebody please help me!!!!!

Collin79
 
The one thing you did forget in the code was &quot;DataBound1.DataSource=...&quot; right before the &quot;Databound1.DataMember=...&quot;.
 
Hey andrew pls don't be silly in the first place the program would not run if the END SUB was not there. It checks first for the syntax before it is executed.
 
Thanks all:

The error occurs over this line:

DataCombo1.DataField = Company

with this error:

Compile error:

type mismatch

and I can see highlighted .Datafield
 
About Datasource:

It's the same for all objects, I'm using Dataenvironment1

Any hint?

Thanks

Collin79
 
Hey, it's working ok, thanks to all that help me

Collin79
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top