Combination Box Selection

  • Thread starter Thread starter GRIGBY
  • Start date Start date
G

GRIGBY

Hi,

I've tried many of the examples found w/in NG. However,
I'm still unable to do the following, assuming this can
be done.

I have a Parts Request form (frmPartRequest) which
contain a text field "txtEqModelNum" which is only for
display purposes. In short there is a serial number, and
the selection of the serial number display a description
and model number.

I have a sb-form (fsubPartReqItems) which is linked to
the frmPartRequest by a unique number. This form
contains a field "cboPartReqItemPN" (Part Request Item
Part Number).

The problem comes with selecting information. The person
completing the form could select a part number for
another type of equipment, i.e a PC Part, whne a Printer
Part is Required.

How do I set the cboPartReqItemPN to show only those
parts associated to the model number in the txtEqModelNum
on the Part Request Form. Is this possible??? I
considered CBO2 based on Cbo1, but I do not want the user
to have to reselect a model number, nor do I wish to add
anymore fields to the sub-form... Any ideas,
suggestions, possible code...

Thanks in advance for any help and information!
Greg
 
Greg,

The general principle here, concerning the way this is commonly done,
is that you make a query to serve as the RowSource of the
cboPartReqItemPN combobox. This query uses the data in txtEqModelNum
in the current record as its criteria, in such a way that the records
returned by the rowsource query are only those related to the Model in
question.

Hope that gives the idea. I think we would need to know more details
of your data before we could give more specific advice.



Hi,

I've tried many of the examples found w/in NG. However,
I'm still unable to do the following, assuming this can
be done.

I have a Parts Request form (frmPartRequest) which
contain a text field "txtEqModelNum" which is only for
display purposes. In short there is a serial number, and
the selection of the serial number display a description
and model number.

I have a sb-form (fsubPartReqItems) which is linked to
the frmPartRequest by a unique number. This form
contains a field "cboPartReqItemPN" (Part Request Item
Part Number).

The problem comes with selecting information. The person
completing the form could select a part number for
another type of equipment, i.e a PC Part, whne a Printer
Part is Required.

How do I set the cboPartReqItemPN to show only those
parts associated to the model number in the txtEqModelNum
on the Part Request Form. Is this possible??? I
considered CBO2 based on Cbo1, but I do not want the user
to have to reselect a model number, nor do I wish to add
anymore fields to the sub-form... Any ideas,
suggestions, possible code...

Thanks in advance for any help and information!
Greg

- Steve Schapel, Microsoft Access MVP
 
Hi,

Here are the basics...
Form: frmPartRequest
Rec SRC: qfrmPartRequest, which contains tblCostCenter,
tblEmployee, tblePartRequest, tbleEquipment, and tbl
Product.

In general, the person clicks the Create PR button, which
opens the frmPartRequest, which is prefilled with
information from the Equipment Record (tblEquipment).
However, some of the fields on the frmPartRequest display
information, as opposed to saving info within the
tblPartRequest. In this case, the txtEqSerNum found on
the frmPartRequest is saved with the record, while the
txtEqModelNum only displays the Model number which is
based on the serial number field on the frmPartRequest.

The Subform (fsubPartRequestItem) is based on:
qfsubPartRequestItem, which contains qryPart and
qryPartRequestItem. The qryPartRequestItem contains a
field called txtPRItemPartNum, which on the form
(fsub...) is a combo box which currently displays all the
parts of say a printer, or PC, etc... The qryPart
contains txtPartNum and txtPartProdModelNum so that an
association to tblProduct can be completed.

The fsub and parent form are linked on a unique tracking
call tracking number.

Layout of the parent form is col oriented, while fsub is
con't. Fsub layout is Rec#, Date, ReqType,
[txtPRItemPartNum], QtyOrder, QtyRecd,DateClosed. It is
the txtPRItem... that is a combo box on the fsub...

I'm trying to set the fsub... txtPRItem... to display
only those parts "txtPartNum" which match the
frmPartRequest field txtEqModelNum, which is on a
displayed field...

In general, the structure of the tblPart is:
Model Number, which links to the Product Table
Part Number, such as 99A0001, or say RG5-1234-123 etc...
Part Description Chargining roller, fuser assy etc...
The PK is Part Number.

The Product Table structure is:
Model Number, which is the PK
OEM ID, i.e MS, IBM, Dell etc...
OEM Make LaserJet, DeskJet, etc...
OEM Series, i.e 6P, 1200C, PL, XL, GX110 etc...

I hope I supplied the correct information for a better
assessment...

Again thanks for any help you can give...
Greg
 
Greg,

If I understand you correctly, this is the problem in a nutshell...
You want the txtPRItemPartNum combobox, on the subform, to restrict
the items displayed to only the parts associated with the Product as
per the main form. The RowSource of the combobox is a query called
qryPart. One of the fields in qryPart is txtPartProdModelNum which is
the equivalent of the Model Number field in the Product table. And the
Model Number of the product is shown on the main form in a textbox
txtEqModelNum. Am I correct?

If so, in the criteria of the txtPartProdModelNum field in qryPart,
you need to put...
[Forms]![frmPartRequest]![txtEqModelNum]

- Steve Schapel, Microsoft Access MVP


Hi,

Here are the basics...
Form: frmPartRequest
Rec SRC: qfrmPartRequest, which contains tblCostCenter,
tblEmployee, tblePartRequest, tbleEquipment, and tbl
Product.

In general, the person clicks the Create PR button, which
opens the frmPartRequest, which is prefilled with
information from the Equipment Record (tblEquipment).
However, some of the fields on the frmPartRequest display
information, as opposed to saving info within the
tblPartRequest. In this case, the txtEqSerNum found on
the frmPartRequest is saved with the record, while the
txtEqModelNum only displays the Model number which is
based on the serial number field on the frmPartRequest.

The Subform (fsubPartRequestItem) is based on:
qfsubPartRequestItem, which contains qryPart and
qryPartRequestItem. The qryPartRequestItem contains a
field called txtPRItemPartNum, which on the form
(fsub...) is a combo box which currently displays all the
parts of say a printer, or PC, etc... The qryPart
contains txtPartNum and txtPartProdModelNum so that an
association to tblProduct can be completed.

The fsub and parent form are linked on a unique tracking
call tracking number.

Layout of the parent form is col oriented, while fsub is
con't. Fsub layout is Rec#, Date, ReqType,
[txtPRItemPartNum], QtyOrder, QtyRecd,DateClosed. It is
the txtPRItem... that is a combo box on the fsub...

I'm trying to set the fsub... txtPRItem... to display
only those parts "txtPartNum" which match the
frmPartRequest field txtEqModelNum, which is on a
displayed field...

In general, the structure of the tblPart is:
Model Number, which links to the Product Table
Part Number, such as 99A0001, or say RG5-1234-123 etc...
Part Description Chargining roller, fuser assy etc...
The PK is Part Number.

The Product Table structure is:
Model Number, which is the PK
OEM ID, i.e MS, IBM, Dell etc...
OEM Make LaserJet, DeskJet, etc...
OEM Series, i.e 6P, 1200C, PL, XL, GX110 etc...

I hope I supplied the correct information for a better
assessment...

Again thanks for any help you can give...
Greg
 
Hi,

Thanks for your help. As it turns out I was not entering
that information into the correct location, and using the
wrong field.

Again, thanks for pointing this error out to me. I knew
it was something simple, but it was just eluding me.

Greg
-----Original Message-----
Greg,

If I understand you correctly, this is the problem in a nutshell...
You want the txtPRItemPartNum combobox, on the subform, to restrict
the items displayed to only the parts associated with the Product as
per the main form. The RowSource of the combobox is a query called
qryPart. One of the fields in qryPart is txtPartProdModelNum which is
the equivalent of the Model Number field in the Product table. And the
Model Number of the product is shown on the main form in a textbox
txtEqModelNum. Am I correct?

If so, in the criteria of the txtPartProdModelNum field in qryPart,
you need to put...
[Forms]![frmPartRequest]![txtEqModelNum]

- Steve Schapel, Microsoft Access MVP


Hi,

Here are the basics...
Form: frmPartRequest
Rec SRC: qfrmPartRequest, which contains tblCostCenter,
tblEmployee, tblePartRequest, tbleEquipment, and tbl
Product.

In general, the person clicks the Create PR button, which
opens the frmPartRequest, which is prefilled with
information from the Equipment Record (tblEquipment).
However, some of the fields on the frmPartRequest display
information, as opposed to saving info within the
tblPartRequest. In this case, the txtEqSerNum found on
the frmPartRequest is saved with the record, while the
txtEqModelNum only displays the Model number which is
based on the serial number field on the frmPartRequest.

The Subform (fsubPartRequestItem) is based on:
qfsubPartRequestItem, which contains qryPart and
qryPartRequestItem. The qryPartRequestItem contains a
field called txtPRItemPartNum, which on the form
(fsub...) is a combo box which currently displays all the
parts of say a printer, or PC, etc... The qryPart
contains txtPartNum and txtPartProdModelNum so that an
association to tblProduct can be completed.

The fsub and parent form are linked on a unique tracking
call tracking number.

Layout of the parent form is col oriented, while fsub is
con't. Fsub layout is Rec#, Date, ReqType,
[txtPRItemPartNum], QtyOrder, QtyRecd,DateClosed. It is
the txtPRItem... that is a combo box on the fsub...

I'm trying to set the fsub... txtPRItem... to display
only those parts "txtPartNum" which match the
frmPartRequest field txtEqModelNum, which is on a
displayed field...

In general, the structure of the tblPart is:
Model Number, which links to the Product Table
Part Number, such as 99A0001, or say RG5-1234-123 etc...
Part Description Chargining roller, fuser assy etc...
The PK is Part Number.

The Product Table structure is:
Model Number, which is the PK
OEM ID, i.e MS, IBM, Dell etc...
OEM Make LaserJet, DeskJet, etc...
OEM Series, i.e 6P, 1200C, PL, XL, GX110 etc...

I hope I supplied the correct information for a better
assessment...

Again thanks for any help you can give...
Greg

.
 
Back
Top