473,670 Members | 2,661 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

7 New Member
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
1 2621
Lysander
344 Recognized Expert Contributor
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

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

Similar topics

3
2030
by: Billy Jacobs | last post by:
I have created a DataGridColumnDatePicker Component so that I can put a datetimepicker control in my datagrid. It almost works. When I put my mouse in the cell it changes to a datetimepicker control. I can then select a date which displays in the cell. When I leave the cell however I get the following error:
4
7004
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the user enters the last qualifying field on the main form. In one case this works fine, the subform shows the data the user wants to update -- which means showing all the data put in previously (ie showing this via the requery and the continuous...
0
2159
by: Jax | last post by:
I am using a class that inherits from the DataGridTextBoxColumn. It adds a combo box into the column where it displays a selection of choices. The problem I have is that when this comboBox loses focus I lose the selected text. And this next line isn't setting the text in the cell. // code within the custom DataGridComboBoxColumn class this.TextBox.Text = this.ComboBox.SelectedItem.ToString();
1
3034
by: Henry | last post by:
I was trying to work through the Lab 2 exercises in the Microsoft's Windows-Based Applications in Visual C#. While I am not showing any errors I am also not seeing the mainMenu object when I run the application. I am wondering if someone could point out why in the code below: using System; using System.Drawing; using System.Collections;
6
3750
by: Ron L | last post by:
I have a dataset whose source is a SQL 2k stored procedure that I am trying to display in a datagrid. This datasource has 4 columns that I am interested in here, a text column and 3 value columns corresponding to permissions to certain data classes. I want to put the permission values in combo boxes in the grid and instead of displaying the numeric values, have the combo box display a string that corresponds to the numeric value (i.e. No...
0
407
by: dbuchanan | last post by:
ComboBox databindng Problem == How the ComboBox is setup and used: My comboBox is populated by a lookup table. The ValueMember is the lookup table's Id and the DisplayMember is the text from a corresponding field in the lookup table. In my data table we store the ID in what I will call the 'key' field. == Description of the desired operation:
4
4003
by: bwaha | last post by:
First time trying to create an executable with py2exe. I have a small program which makes use of python23 (2.3.5?), wxpython ('2.6.2.1'), matplotlib ('0.83.2'), win32com (latest?), Numeric ('23.7') on Windows XP & Win2000. The program runs without problem but as an exe it doesn't even get to showing the GUI. I get the following error log when I run the executable. Traceback (most recent call last): File "mpival3.py", line 1264, in ?
4
1811
by: JJGarcia | last post by:
Hi Everyone, I'll try to explain the process I'm following, I'm new to this so I'm triying the easy way first, probably the lasyest too! I created a new Project, drag in to it a SQLConnection, configured, dragged an Dataadapter per each table I need it, then generated the dataset, after that, I stablished the relations between tables, then, went over to the datasources, choose the parent datasource and clicked on the + sign, it...
3
5311
by: Gerrit | last post by:
Hi, I try to learn programming in c# with databinding controls. Now I have a problem with a ComboBox with the advanced properties for databinding, I want to set the DataSourceUpdateMode to OnPropertyChanged, but then the combobox does not display the right displaymember. Below is my sample code (it is working, when you paste it in a new windowsapplication, in a form and delete some generated code, but it is not a useful program but...
2
2629
by: sirdavethebrave | last post by:
Hi guys - I have written a form, and a stored procedure to update the said form. It really is as simple as that. A user can go into the form, update some fields and hit the update button to update the information which is stored in a SQL database. In testing we noticed that the form was updating correctly but the update mechanism was also updating the first record of the table in the sql database every time. No error messages are on...
0
8468
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8386
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8814
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8591
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7415
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5683
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4209
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4390
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2041
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.