General discussion

Locked

Access 2000 field auto populate question

By ironfist03 ·
I need to have a field in a form auto populate based on input to a previous fields entry.. example,, i have a combo box for a part number with the row source entry coming from a query,, when this field has the part number selected and you tab out of it i would like to have the next field auto populate with the description.. anybody have any clues.. if its vba you will have to be "do a, b, c, etc" with your explaination.. thanks..

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by jc2it In reply to Access 2000 field auto po ...

If the part number field and the part description field are in the same field this should not be a problem at all. In fact it should do this automagically in Access. At least this has always been my experience.

Collapse -

by jc2it In reply to

"part number field and the part description field are in the same field"

Oops, that should have said, "part number field and the part description field are in the same table"

Collapse -

by ironfist03 In reply to

let me further clarify my question,, first,, yes the part_num and desc are in the same table,, however i am using 2 tables,, one is the table where the form stuffs the inputted data,, the 2nd i am using as the input for the part_no in a combo box so that if the user types a bogus part number it will choke at that point,, i only want legal part numbers at data input.. the problem is that there are 2 fields i need to tie together,, when the user types the part_num (from a query for the fields row source)on field a)then i am trying to get the description of that part to auto populate field b).. and that is my conundrum..

Collapse -

by leewolff2 In reply to Access 2000 field auto po ...

What I have done in a few of my applications is as follows:
Both the Part Number and Part Description fields are comboboxes. Their lists are set to a source table consisting of both the part number and description. The column count property is set to 2. Both columns are displayed in the list for the part number field. Only the description column is displayed in the list for the description combobox. This is done by setting the column widths property to 0.5";5".
Since both the part number and description values are present in a selection in each combobox, I can set the choice in the unused combobox as follows:

cboICD_9_CM_Diagnosis_Code ~= the part number field
cboICD_9_CM_Description ~= the part description field
This code was from a medical application.

Private Sub cboICD_9_CM_Diagnosis_Code_AfterUpdate()
If cboICD_9_CM_Diagnosis_Code.ListIndex > -1 Then
'If a choice has been made...
cboICD_9_CM_Description.Value =
cboICD_9_CM_Diagnosis_Code.Column(1)
'Make the corresponding choice in the other
'combobox
End If
End Sub

Private Sub cboICD_9_CM_Description_AfterUpdate()
If cboICD_9_CM_Description.ListIndex > -1 Then
'If a choice has been made...
cboICD_9_CM_Diagnosis_Code = cboICD_9_CM_Description.Column(0)
'Make the corresponding choice in the other
'combobox
End If
End Sub

Collapse -

by ironfist03 In reply to Access 2000 field auto po ...

This question was closed by the author

Back to Software Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums