Really need help with autopopulating a few fields

R

Richnep

Additional Info:

The row source for these list boxes are the 3 queries (1 for each).


So the fields store thier data (and the fields are bound to) columns
in
tblAntibody. The row source is the free standing table
tblCatalogPartNumbers.
I am doing this all through the Access 2003 front end. This is the
result of
me trying to get the UnqualifiedPartNumber, NIPartNumber, and PIPart
Number
to auto populate once a selection is made in the CatalogNumber field.

So essentally what you have is the catalog number is a combo box
pulling
it's values from the column CatalogNumber in the
tblCatalogPartNumbers. On
the form the other 3 fields are list boxes that pull thier data from
a
query(1 seperate query for each field) that says "Take the selected
catalog
number on the form and match that catalog number in
tblCatalogPartNumbers,
then pull the data for X field (Unqualified Part Number,
NIPARTNUMBER,PIPARTNUMBER) that corresponds to the part number. Here
is the
query SQL:

SELECT qryfrmOEtblListCatalogPartNumbers.UnqualifiedPartNumber,
qryfrmOEtblListCatalogPartNumbers.CatalogNumber
FROM qryfrmOEtblListCatalogPartNumbers
WHERE
(((qryfrmOEtblListCatalogPartNumbers.CatalogNumber)=[Forms]!
[frmOrderEntry]![CatalogNumber]));


Any help is appreciated
 
G

Guest

Confusing, but I'll give it a try..

Comments inline....



What is the name of the data entry form?

Why aren't you storing the PK of "tblCatalogPartNumbers" record in the table
"tblAntibody"? Then you wouldn't need the list boxes.

Do you mean the combo box "Row Source"?

Is there more than one value of UnqualifiedNumber,NIPartNumber, and
PIPartNumber for each CatalogNumber ?

To "autopopulate", you could set the combo box Row Source to:

"SELECT CatalogNumber, UnqualifiedNumber,NIPartNumber, PIPartNumber FROM
tblCatalogPartNumbers;"

Then in the after update event of the combo box, use the Column() property
to "autopopulate" three text boxes:

Sub combobox_AfterUpdate()

Me.Text1= Me.combobox.Column(1)
Me.Text2= Me.combobox.Column(2)
Me.Text3= Me.combobox.Column(3)

End Sub

Of course, the names of the controls would need to be changed to the actual
names.



Are we on the data entry form or the form CatalogNumber? How do you "save"
the record? Do you have to select a value in each list box? Can one or more
list boxes be unselected (so no value is stored)?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top