I saw posts in Dependent listboxes on access forms, which problem is very similar to my.
I’m from Bulgaria and working over to create an MS Access application.
I used in my project given code :
Expand|Select|Wrap|Line Numbers
- Private Sub Country_AfterUpdate()
- With Me![Region]
- If IsNull(Me!Country) Then ' if no country is selected
- .RowSource = "" ' leave row source of Region blank
- Else ' if country is selected
- ' populate the Region combo box with Regions where Country is as selected
- .RowSource = "SELECT RegionID, RegionName " & _
- "FROM tlkpRegion " & _
- "WHERE CountryID=" & Me.Country
- End If
- Call .Requery ' requery the region combo box to show the selection
- End With
- End Sub
I have table, with next structure :
Table1
ID (Primary Key - AutoNumber)
CountryCode - contains country code
RegionCode - contains region code
I create Single Form, which Record Source is Table1
This form contains :
ComboBox1 - Country
ComboBox2 - Region
When I list the records with Record Selector only in last actualized records Combo boxes shows the names of country and region.
When I move between records forward or back only the value in ComboBox1 is visible.
ComboBox2 is empty. The value present in the table but the result is invisible.
Has anybody any idea what is wrong?
I will appreciate any help
Annivanova