View Single Post
  #1 (permalink)  
Old January 18th, 2008, 02:22 PM
Goobz Goobz is offline
Registered User
Join Date: Jan 2008
Location: Spanaway, WA, USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Goobz Send a message via AIM to Goobz Send a message via MSN to Goobz Send a message via Yahoo to Goobz
Default Trying to Utilize Bound Combo Boxes with no luck!

Okay all.. Here's my deal... I have tried and tried and tried to get these to work... I'm going to post what I have done, and what I am trying to do, and see if someone can help me figure crap out...

tblBuilding - PK is BuildingIDNum - Autonumber
tblBuildingZones - FK is BuildingIDNum via
SELECT DISTINCTROW Building.BuildingIDNum, Building.Name FROM Building ORDER BY Building.BuildingIDNum;
  cboBuilding - This has Building 1, Building 2, etc. The field displaying this info is "Name" in tblBuilding.

  cboBuildingZones - This has different "zones" for Building 1, Building 2, etc., that depending on which building is chose in cboBuilding, this will populate with the "zone" - First Floor, Second Floor, Mezzanine, etc. The field displaying this info is "InBuildingLocation" in tblBuildingZones. However, the field I need to write in the underlying form table is "DN.911Zone".

I wrote the following code in AfterUpdate of the Building ID, and I'm getting a highlighted yellow on "End Sub" as soon as I try and populate my cboBuildingZones box.

Private Sub cboBuilding_AfterUpdate()
    With Me![cboZoneID]
    If IsNull(Me!cboBuilding) Then
      .RowSource = ""
      .RowSource = "SELECT [InBuildingLocation] " & _
                   "FROM tblBuildingZones " & _
                   "WHERE [BuildingIDNum]=" & Me!cboBuilding
    End If
    Call .Requery
  End With
End Sub
I hope someone can help me out either by fixing my code, or taking the 2 minutes to write what probably should be a really stupid quick entry that I just can't get my hands around!

Thanx in advance!