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

Problem showing records relating to a combobox value & how to make textbox read-only?

P: 7
Hi,

I need help with this problem as soon as possible (within a couple of days).

This is the first time I have ever used Access 2007 and therefore I am having some problems - especially as I am attempting some things I have never used in a database before this.

As you can see in the picture, I need to create a form to edit pet details. I want to use a combo box to select the owner, then (if possible) have all of the records in the PET table that match this owner appear below.

And a separate problem: The 'Name' field for each pet should be read-only. I cannot find the setting in the properties, am I missing it or is it somewhere else?

I appreciate any help. Using Access 2007 on Windows Vista.

Thanks.

Please note: the owner-pet scenario is not exactly what I am doing, but is a lot easier way to illustrate/explain my problem.




-------------
Table names are as follows: "T_OWNER" and "T_PET"

Just to clarify: the problem I am having is that when I test the form (and the control source is equal to "OwnerID_T_PET"), I select an option from the combo box (which takes it's values from the OwnerID field in the T_OWNER table) -- but the 'PetID' and 'Name' and 'Type' and 'DOB' do not change as they should.

Also, when I test the form (but this time with the control source equal to simply "OwnerID"), the form does not allow me to select a value from the list - the following message appears in the status bar:

Control can't be edited; it's bound to AutoNumber field 'OwnerID'.

* OwnerID is an AutoNumber field.
PetID is a text field, as it is intended to be entered by the end-user.

If you need more information, just ask.
Jun 2 '07 #1
Share this Question
Share on Google+
1 Reply


Expert 100+
P: 344
Hi,

I need help with this problem as soon as possible (within a couple of days).

This is the first time I have ever used Access 2007 and therefore I am having some problems - especially as I am attempting some things I have never used in a database before this.

As you can see in the picture, I need to create a form to edit pet details. I want to use a combo box to select the owner, then (if possible) have all of the records in the PET table that match this owner appear below.

And a separate problem: The 'Name' field for each pet should be read-only. I cannot find the setting in the properties, am I missing it or is it somewhere else?

I appreciate any help. Using Access 2007 on Windows Vista.

Thanks.

Please note: the owner-pet scenario is not exactly what I am doing, but is a lot easier way to illustrate/explain my problem.




-------------
Table names are as follows: "T_OWNER" and "T_PET"

Just to clarify: the problem I am having is that when I test the form (and the control source is equal to "OwnerID_T_PET"), I select an option from the combo box (which takes it's values from the OwnerID field in the T_OWNER table) -- but the 'PetID' and 'Name' and 'Type' and 'DOB' do not change as they should.

Also, when I test the form (but this time with the control source equal to simply "OwnerID"), the form does not allow me to select a value from the list - the following message appears in the status bar:

Control can't be edited; it's bound to AutoNumber field 'OwnerID'.

* OwnerID is an AutoNumber field.
PetID is a text field, as it is intended to be entered by the end-user.

If you need more information, just ask.
Change your form into a form and subform. In the main form, just have the combo box (showing all the Owners from the Owner table)

In the sub-form, have your petid, name etc, and Owner from the pet table. You can make Owner invisible. Drop the subform into the main form and then link child and master fields to Owner.
When you make a selection in the combo box, the subform will display all the pets.

To make Name read only, go to the controls properties in the sub-form and set enabled=false, locked=true.

Hope this helps
Jun 2 '07 #2

Post your reply

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