Drop-down list box not populating from secondary data source

J

joeman

I'm connecting to a SQL database for my data sources. I've got my MAIN set,
and a secondary for pulling data.

I set a dropdown box to bind to Table A, Field 1. Field 1 is a non-null.
The binding is good (no errors). I then go to the properties of the dropdown
box, and select "Look up values..." in the list box entries area on the data
tab. I select the secondary data source, then choose Table B in the entries
field. Table B is a code table. Under value, I select Table B Field 1 (the
ID code), and under Display Name I select Table B Field 2 (the description).
Apply and OK. When I preview the form, the drop down reveals only a red
asterisk.

I checked the code table in SQL, and it's populated.

What gives? What am I missing?
 
S

S.Y.M. Wong-A-Ton

Trying to reproduce your problem here, but not having much luck; everything
works on my end. It looks like you have done all the right steps. Strange...

What you could try to do is add an extra field to your Main data source
(independent of the binding to the database table) and then bind it to the
secondary data source (Table B) to see whether the values of Table B will
appear. If they do, the problem is probably with Table A or its binding.

Are all Table A's Field 1 fields filled with values from Table B Field 1?
And is the data type of Field 1 in Table A the same as that of Field 1 in
Table B?
 
J

joeman

Thanks, SYM. I figured out what the problem was, and it was pretty silly.
I'd set up my secondary data connection with the same relational structure as
my main. The problem was that there isn't any data in this database yet, and
if there had been, it would have pulled every instance of Table B Field 2 to
display in the dropdown (unless I manually entered a "distinct" in the SQL
language).

So I created a seperate secondary data source for every code table
(including B), and it's working fine now. Seems the problem was with the
driver, not the car. *sheepish grin* Thanks for helping!
 
S

S.Y.M. Wong-A-Ton

Anybody can make a mistake. Hey, but it's working now, right? And you're
welcome!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top