data populating from drop down menu (1 Viewer)

mdhr

New member
Local time
Today, 05:28
Joined
Jul 12, 2017
Messages
6
Hi,

I am trying to make a drop down menu and populate the data of the selected object.

when selecting a city from the drop down menu, the resulting table or query should display all the details of the selected city.

I hope to find some solution here.

Thank you.
 

Attachments

  • Database2.accdb
    732 KB · Views: 37

Ranman256

Well-known member
Local time
Today, 08:28
Joined
Apr 9, 2015
Messages
4,337
The query for the combo box that holds the details, should use cboCity in its criteria....
Select detail from table where city = forms!myForm!cboCity

But you must put a requery in the AFTERUPDATE event so the cbo box it can see the new pick...

Code:
Sub cboCity_afterupdate()
CboDetail.requery
End sub
 

mdhr

New member
Local time
Today, 05:28
Joined
Jul 12, 2017
Messages
6
Thanks Ranman!!

I am new to Access so i couldnot catch up with your explanation. Could you explain more in detail? where shall i write the code
and the cboCity?
 

Ranman256

Well-known member
Local time
Today, 08:28
Joined
Apr 9, 2015
Messages
4,337
Yes, in cboCity...
Select cboCity, properties, events tab, AFTERUPDATE event box,
Click the ellipsis button in the box,
Click CODE,
Put the code here.
 

mdhr

New member
Local time
Today, 05:28
Joined
Jul 12, 2017
Messages
6
Cannot I write formula in the query, to give the detail of the selected object?

In the query, populate the data of the city Hamburg only, if Hamburg is selected in the drop down menu in the table.

Is there some way to achieve this?

I am trying to do it with the lookup table.
 

Users who are viewing this thread

Top Bottom