show a value from another table in a form

Programming

Registered User.
Local time
Today, 09:30
Joined
Jul 5, 2018
Messages
20
I have two tables
Students table where it has StudentName and StudentID
Course table where it has Student ID - CourseName -CourseID
The field pf StudentID in the course table, I made it lookup field to show the StudentName instead of the StudentID.

In the form of courses however, it shows the StudentName if the field of type combobox, If I change it to text box it shows the StudentsID.

How can I still show the student name in the form of courses ,even though ,I did not store studentName in the course table.

I did it before , but I forgot how.
Thank you.
 
Why do you change to textbox? Use combobox. Otherwise options are to include Students table in form RecordSource joined to Course table or use DLookup function.
 
Because I want data to be shown in textbox. I don't want the user to select or choose anything
 
Get rid of the lookup field in the Courses table. It's not needed and can be confusing

Create a query joining both tables using StudentID.
Use that as the record source for your form
Your combo should have three columns - StudentID (bound /hidden), LastName, FirstName

If instead you want a textbox, use e.g =LastName & ", " & FirstName as it's control source
 
but I do not want to show it in combo , I want to show it in text box
 
Because I want data to be shown in textbox. I don't want the user to select or choose anything

Then how do you expect the student name to get there...if you "don't want the user to select or choose anything?"

Linq ;0)>
 
@Programming,

I think you are confusing WHAT and HOW. You and readers need a clear description of the requirement in simple English. This is the WHAT (I'm trying to accomplish). With that clear requirement, readers will offer alternatives/options as to HOW that might be achieved with MS Access.
As always, clarity in communication is key.

--Avoid lookups at table field level as Ridders advised.
 

Users who are viewing this thread

Back
Top Bottom