Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Controls for Fields on a Continuous Form

Status
Not open for further replies.

LiamOC

Technical User
Sep 12, 2002
9
0
0
IE
I have a continuous form which has the following fields:

Code Description Quantity


Code is a combo box with a list of values from an underlying table. When I select a particular code I need the relevant description to appear in the Description field.

I have managed this much by inserting the following code into the AfterUpdate Event of the Code combo box:

Description = Code.Column(1)

However the problem is that because it is a continuous form when I select the next code to enter on the following line, the Description field from all the previous entries on the form changes to the description associated with the code that is being selected.

How do I remedy this so that each line of the form has a description field that only associates itself with the value for the code on the same line?

If this makes any sense, I would love if someone could help me out!

Thanks,
Liam

 
LiamOC,

Are the fields Code, Description, and Quantity all in the same table?

If they are, why use two combo boxes. Just show both the Code and Description columns in the same combo box.

Jdemmer
 
Liam,

Usually the best way to do this is to get rid of the continuous form and use a list box instead. Then add a button to add a record to the list box, which will be done on a simple form, opened in add data mode. Then make the listbox respond to a double-click by opening the same form, filtered to just that record.

I try to make it so that a list is for displaying data, not editing it. If users want to edit data they see in a list they have to double-click it to open up a single form. I find this cuts down on the amount of bad data users enter in the database.

Jeremy =============
Jeremy Wallace
Designing and building Access databases since 1995.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top