I have a simple database for keeping track of who has what keys for our church.
[key] table
key_id(autonumber)
building_id(foreign key to building table)
kdescription(text field describes what the key opens)
keycode(text field for code stamped on key for ID
kblank(code that indicates blank to use to make the key)
[building] table
building_id(autonumber)
bname(text field to hold building name)
I have an unbound combo box that users can chose the building. Here is the row source:
SELECT building.bname, building.building_ID FROM building;
Changing this causes a second unbound combo box to be populated with just the keys for that building.
This is the code for the change event onthe first combo box:
cboKey.RowSource = "SELECT key.keycode, key.kdescription, key.key_id, key.building_id FROM [key] WHERE key.building_id=" & Me.cboBuilding.Column(1) & ";"
I can use cboKey.Column(0) and cboKey.Column(1) with no problem...the problem is when I try to use cboKey.Column(2). I can't do anything with it. I am trying to add it to a sql command, but it is always blank even though the key_id is obviously a required field, and populated for all records on the table.
When I tried to assign it to sometextbox.value...the text box is blank.
When I tried to assign it to somelable.caption...the lable is blank.
How can I use this field?
I would appreciate any help you could give.
[key] table
key_id(autonumber)
building_id(foreign key to building table)
kdescription(text field describes what the key opens)
keycode(text field for code stamped on key for ID
kblank(code that indicates blank to use to make the key)
[building] table
building_id(autonumber)
bname(text field to hold building name)
I have an unbound combo box that users can chose the building. Here is the row source:
SELECT building.bname, building.building_ID FROM building;
Changing this causes a second unbound combo box to be populated with just the keys for that building.
This is the code for the change event onthe first combo box:
cboKey.RowSource = "SELECT key.keycode, key.kdescription, key.key_id, key.building_id FROM [key] WHERE key.building_id=" & Me.cboBuilding.Column(1) & ";"
I can use cboKey.Column(0) and cboKey.Column(1) with no problem...the problem is when I try to use cboKey.Column(2). I can't do anything with it. I am trying to add it to a sql command, but it is always blank even though the key_id is obviously a required field, and populated for all records on the table.
When I tried to assign it to sometextbox.value...the text box is blank.
When I tried to assign it to somelable.caption...the lable is blank.
How can I use this field?
I would appreciate any help you could give.