Hi,

I feel like a dolt here but I can not get this combo box to do what I want
and I'm not sure what my problem is. I'm setting up a simple inventory
database, I have two tables; computers and users.

The computers table as three fields in it:
prop_no Integer
description C(25)
user_id Integer

The users table has three fields in it:
user_id Integer
first_name C(15)
last_name C(20)

I'm using the treeview control to list the users and thier computers, this
works. When I click on a computer node it looks up the computer and
displays the information, this works.

Here's my problem:
I want to have a combo box that initially lists the current user's full
name. For now I'd accept the first name. So I have my combo box configured
like this:
BoundColumn = 2
BoundTo = T
ControlSource = computers.user_id
RowSource = users.first_name, users.user_id
RowSourceType = I tried both, 2 - Alias and 6 - Fields, both give the same
result.
ColumnCount = 2
Style = 2 - Dropdown List

When I run my form I get an error, "Field phrase is not found." What am I
doing wrong?? I have used this object before and I thought I set it up like
this. I'm sure it's something simple and I do appologize for taking up
everyone's time and bandwidth with these simple problems.

Thanks in advance,
Linn

Re: Combo Box help needed by Stefan

Stefan
Fri Aug 18 16:05:46 CDT 2006

> RowSource = users.first_name, users.user_id

Try w/ an alias only for the first field
RowSource = "users.first_name, user_id"


hth
-Stefan



--
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------
"Linn Kubler" <lkubler@chartwellwisc2.com> schrieb im Newsbeitrag
news:uou4nEvwGHA.5064@TK2MSFTNGP06.phx.gbl...
> Hi,
>
> I feel like a dolt here but I can not get this combo box to do what I want and I'm
> not sure what my problem is. I'm setting up a simple inventory database, I have
> two tables; computers and users.
>
> The computers table as three fields in it:
> prop_no Integer
> description C(25)
> user_id Integer
>
> The users table has three fields in it:
> user_id Integer
> first_name C(15)
> last_name C(20)
>
> I'm using the treeview control to list the users and thier computers, this works.
> When I click on a computer node it looks up the computer and displays the
> information, this works.
>
> Here's my problem:
> I want to have a combo box that initially lists the current user's full name. For
> now I'd accept the first name. So I have my combo box configured like this:
> BoundColumn = 2
> BoundTo = T
> ControlSource = computers.user_id
> RowSource = users.first_name, users.user_id
> RowSourceType = I tried both, 2 - Alias and 6 - Fields, both give the same result.
> ColumnCount = 2
> Style = 2 - Dropdown List
>
> When I run my form I get an error, "Field phrase is not found." What am I doing
> wrong?? I have used this object before and I thought I set it up like this. I'm
> sure it's something simple and I do appologize for taking up everyone's time and
> bandwidth with these simple problems.
>
> Thanks in advance,
> Linn
>
>


Re: Combo Box help needed by Olaf

Olaf
Fri Aug 18 17:36:07 CDT 2006

> I want to have a combo box that initially lists the current user's full
> name. For now I'd accept the first name.

make it:

BoundColumn = 4
BoundTo = .T.
ColumnCount = 4
ColumnWidths = "0,100,100,0"
ControlSource = computers.user_id
RowSource = "users.first_name-(' '+users.last_name), first_name, last_name, user_id"
RowSourceType = 6 && Fields
Style = 2 && Dropdown List

Fields is more like expressions, as you can see. At least the
first column is evaluated. Seems an expression like tab.field
is problematic in column numbers > 1. But you can also bind
something as this:

users.first_name-(' '+users.last_name), 'first name: '+users.first_name, 'last name: '+users.last_name, user_id

So it could really be seen as a bug, that you can't bind to
users.first_name, users.user_id

Bye, Olaf.