If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Auto Populate a field in a form
I have a form that is associated with a table, there is a
field in the table called ToCode (this is a service code, i.e. 0548), this field is a combo box looking a table that hold a list of these codes with a description (i.e. 0548 Financial & Technical Systems Support Unit.). What happens is when I select a new entry and use the ToCode combo box, this pulls up a list of codes with there name and uses the first row (Code) and add it to the associated table. I want the description to auto add to the table using the selected code from the combo box. Does anybody know how this can be done within the form? |
#2
|
|||
|
|||
The *stored* field is determined by the Bound Column
property of the combo box. I can't understand, though, why you'd want to waste the storage space. You can always get the description from a query joining your table to the ToCode table via the foreign key for printing, displaying on a form, etc. BTW, please do not multi-post. HTH Kevin Sprinkel -----Original Message----- I have a form that is associated with a table, there is a field in the table called ToCode (this is a service code, i.e. 0548), this field is a combo box looking a table that hold a list of these codes with a description (i.e. 0548 Financial & Technical Systems Support Unit.). What happens is when I select a new entry and use the ToCode combo box, this pulls up a list of codes with there name and uses the first row (Code) and add it to the associated table. I want the description to auto add to the table using the selected code from the combo box. Does anybody know how this can be done within the form? . |
#3
|
|||
|
|||
Sorry for multiple postings, the form was not telling me
it had posted them. Thanks for your response. Here is what I am trying to do. There are two fields on a form; Field 1 is a combo box with a list of codes in col 1, and a description for the code in col 2. Field 2 is a description. When on the form and selecting a code from the combo box (Field 1), I would like the see the description automatically appear in the Description (Field 2) from col 2 in the combo box. -----Original Message----- The *stored* field is determined by the Bound Column property of the combo box. I can't understand, though, why you'd want to waste the storage space. You can always get the description from a query joining your table to the ToCode table via the foreign key for printing, displaying on a form, etc. BTW, please do not multi-post. HTH Kevin Sprinkel -----Original Message----- I have a form that is associated with a table, there is a field in the table called ToCode (this is a service code, i.e. 0548), this field is a combo box looking a table that hold a list of these codes with a description (i.e. 0548 Financial & Technical Systems Support Unit.). What happens is when I select a new entry and use the ToCode combo box, this pulls up a list of codes with there name and uses the first row (Code) and add it to the associated table. I want the description to auto add to the table using the selected code from the combo box. Does anybody know how this can be done within the form? . . |
#4
|
|||
|
|||
It's important to distinguish between a field and a
control. Tables have Fields. Forms have Controls-- textboxes, combo boxes, checkboxes, etc., that can be Bound or Unbound. Unbound controls just display data. If Bound, then the data entered into the control is stored in the field to which it is bound. To display both your code and its description, it's neither necessary nor desirable to store the Description redundantly; store only the Code. Set the unbound Description control's Control Source property using the Column property of the combo box. It is zero-based: the first column is referred to by '0', the second '1', etc. Assuming the Description is the second column listed in your combo box' Row Source, set the Description to: = Me!YourComboBoxName.Column(1) HTH Kevin Sprinkel -----Original Message----- Sorry for multiple postings, the form was not telling me it had posted them. Thanks for your response. Here is what I am trying to do. There are two fields on a form; Field 1 is a combo box with a list of codes in col 1, and a description for the code in col 2. Field 2 is a description. When on the form and selecting a code from the combo box (Field 1), I would like the see the description automatically appear in the Description (Field 2) from col 2 in the combo box. -----Original Message----- The *stored* field is determined by the Bound Column property of the combo box. I can't understand, though, why you'd want to waste the storage space. You can always get the description from a query joining your table to the ToCode table via the foreign key for printing, displaying on a form, etc. BTW, please do not multi-post. HTH Kevin Sprinkel -----Original Message----- I have a form that is associated with a table, there is a field in the table called ToCode (this is a service code, i.e. 0548), this field is a combo box looking a table that hold a list of these codes with a description (i.e. 0548 Financial & Technical Systems Support Unit.). What happens is when I select a new entry and use the ToCode combo box, this pulls up a list of codes with there name and uses the first row (Code) and add it to the associated table. I want the description to auto add to the table using the selected code from the combo box. Does anybody know how this can be done within the form? . . . |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Strange stLinkCriteria behaviour on command button | Anthony Dowd | Using Forms | 3 | August 21st, 2004 03:01 AM |
dlookup | miaplacidus | Using Forms | 9 | August 5th, 2004 09:16 PM |
auto entry into second table after update | Tony | New Users | 13 | July 9th, 2004 10:42 PM |
NUMBERING the pages | Bob | New Users | 7 | June 14th, 2004 12:20 AM |
Supress blank lines in DOCPROPERTY field | Mary | Formatting Long Documents | 10 | May 25th, 2004 07:27 PM |