Foreign Keys/Select

P

Patrick K

Guest
In general I find the support docs to not be very helpful so forgive me if this is a basic question...

I have two tables...contacts, and state with primary keys contacts ID and statesID, respectively (INT). in states I also have a FIELD called state.state_name which is the full state name and is a VARCHAR.

To more easily enter in address info I would like for the contacts.addressstate FIELD to pull down a list of states from the states table...

In the manage table area for contacts I want to put something in the PRIMARY KEY field like this?

"SQL: SELECT distinct statesID, states_name
FROM states"

I want to actual INT number to be entered by I need the refernce full state name to be alongside the pull down so I know what the heck the number means!

is this right? quotes or no quotes? no ";" at the end?

So far I have done this and have not noticed any sort of pull down menu on the field in the contacts table iinterface...

HELP!

Also having trouble with the select field...

what are the proper syntaxes?? A more detailed manual would help...

In any case if I can get these and many other foreign key issues settled, this thng will rock.
 
E

Eugenio

Guest
Patrick K wrote:
>
> In general I find the support docs to not be very helpful so
> forgive me if this is a basic question...
>
> I have two tables...contacts, and state with primary keys
> contacts ID and statesID, respectively (INT). in states I
> also have a FIELD called state.state_name which is the full
> state name and is a VARCHAR.
>
> To more easily enter in address info I would like for the
> contacts.addressstate FIELD to pull down a list of states
> from the states table...
>
> In the manage table area for contacts I want to put something
> in the PRIMARY KEY field like this?
>
> "SQL: SELECT distinct statesID, states_name
> FROM states"
>
> I want to actual INT number to be entered by I need the
> refernce full state name to be alongside the pull down so I
> know what the heck the number means!
>
> is this right? quotes or no quotes? no ";" at the end?

No quotes, no ";".
But at the moment you can't use the ID as value and the name as displayed option, DaDaBIK insert both the values.

>
> So far I have done this and have not noticed any sort of pull
> down menu on the field in the contacts table iinterface...
>
> HELP!
>
> Also having trouble with the select field...
>
> what are the proper syntaxes??

Build a select is very simple, just specify the options......have a look to my tutorial on devarticles.com if you want.

Eugenio.

(Latest version of DaDaBIK when this message was posted: 2.2.1)
 
Top