How do I link a field value to a form when it's not a key?

psulion01

Board Regular
Joined
Sep 25, 2002
Messages
127
Another question...should be easy for most non-beginners...

I have a Clients table/form that contains ClientID (the primary key) and an account number (which is unique, one per ClientID).

I have a Plans table/form with a one->many relationship to the ClientID. For instance, I can have one client with many plans. I want the account number assoicated with the ClientID to populate on my Plans form, as this is the value that I'll be referencing most often, not the autonumbered ClientID.

How do I link the ClientAccount fields on both the Clients and Plans forms?

On a related note, if the fields aren't linked on the Form level, would a report or query that's generated be able to associate the two?

Thanks in advance.
Mike
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Create a query based on both tables.

The SQL would look something like this

SELECT Clients.AccountNo, Plans.PlanID
FROM Clients INNER JOIN Plans ON Clients.ClientID = Plans.ClientID;

(obviously include any other fields required)

This can then be used as the recordsource for the Plans form.
 
Upvote 0
Re: How do I link a field value to a form when it's not a ke

hmm...got some errors that the syntax of subquery is incorrect. Not sure if this will do what I want though. Basically I have account numbers on one form and want them pulled and populated on another form (although the account number is not the primary key and no relationship is established).

I'll keep poking at it...any further thoughts?
 
Upvote 0

Forum statistics

Threads
1,221,813
Messages
6,162,117
Members
451,743
Latest member
matt3388

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top