By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,837 Members | 1,206 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,837 IT Pros & Developers. It's quick & easy.

Problem with Combo boxes in Access

P: 2
Hi,
I saw posts in Dependent listboxes on access forms, which problem is very similar to my.
Iím working over to create an MS Access application.
I used in my project given code :

Code:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Country_AfterUpdate()
  2.     With Me![Region]
  3.         If IsNull(Me!Country) Then ' if no country is selected
  4.             .RowSource = ""  ' leave row source of Region blank
  5.         Else ' if country is selected
  6. ' populate the Region combo box with Regions where Country is as selected
  7.             .RowSource = "SELECT  RegionID, RegionName " & _
  8.                         "FROM tlkpRegion " & _
  9.                         "WHERE CountryID=" & Me.Country
  10.         End If
  11.         Call .Requery ' requery the region combo box to show the selection
  12.     End With
  13. End Sub ]

It is working OK but I have in addition next problem :

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?

This is very important to me and I will appreciate any help

Annivanova
Apr 10 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.