I have two tables like

Staff Table
............
Staff ID
Staff Name
Age
...and more

Staff Salary Table
..................
Staff ID
Staff Name
basic Salary
...and more

Now I have created the Staff Salary form in which I got the staff ID from the staff table using the lookup wizard query in the Staff ID field of the Staff Salary Table
SELECT [Staff Table].[Staff ID] FROM [Staff Table];

but I need one more

When The staff ID was selected from the drop down list, I need the relevant staff name (from the Staff table) also be displayed in the staff salary from .

Can you please let me know how to do this..

You need to change the datasource from your form to a join like this:

select [Staff Salary].[Staff ID], [Staff Salary].[Basic Salary], [Staff Table].[Staff Name] from [Staff Salary] Left Join [Staff Table] 
on [Staff Salary].[Staff ID] = [Staff Table].[Staff ID]

PS: You shouldn't have a Staff Name in the Staff Salary table. You can get it with a join like above when you need it and you are saving yourself the trouble of maintenance (updating it's value whenever the value of Staff Name in Staff Table changes).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.