easiest way do do this??

tommy_mo

Registered User.
Local time
Today, 14:27
Joined
Oct 5, 2006
Messages
42
Hello folks-

I've tried to search for a solution to my problem, but I'm not sure how to phrase it to get a response. The problem:

I have a listbox that displays columns from a query. I would like to use the listbox to populate textboxes that relate to the same row (record). I’ve done it before, but the problem is that the query is run from a table that has no primary key. I’m not sure how to reference the correct record in the listbox without a key.

Is there a way to add a primary key to a query?

Cheers to anyone who can help. -Tom
 
What do you mean add a primary key to a query? Add the field that is the primary key of a table?
 
If your table doesn't have a primary key, which it SHOULD, then you need to fix that before anything else.
 
Thanks for the reply Keith. Sorry if this is confusing.

I need a way to add an autonumber to a query so that the query results have a unique number. The table that the query is currently associated with does not have a primary key, or way to reference individual records.

Hopefully this helps. As you can see I'm pretty much a novice at Access.


Bob- I would love to add a primary key to the table, but the problem is that the table I'm using is a linked table that is imported over and over (from a PDA) and any changes I make to the table will be overwritten.

Cheers. -Tom
 
Last edited:
are you asking about how to reference the columns in a list box?

once you select an item from the list box you can get the data from individual columns by the syntax

mylistbox.columns(n) , remembering that the first column is column 0
 

Users who are viewing this thread

Back
Top Bottom