D
DataDiva via AccessMonster.com
Hi All,
Can't quite seem to get my arms around this one! I have two forms in my
database. The first is to track the inspection of PCB boards as they go
through the manufacturing process [frmBoardInspection]. The second form is to
record any defects found on the boards during inspection [frmBoardDefects].
[frmBoardInspection] has twelve fields where the user will enter data about
the inspection of a particular board. On that form there is a combo box named
[Department] that has a lookup to a table called [LDepartments]. The last
field on the form is a combo box called [Defects_Present]. This cbo also has
a lookup to a table. If the user chooses "no" defects then the record can be
saved and they can start a new record. If the user selects "Yes" to defects,
a command button to open [frmBoardDefects] is enabled. There are seven fields
in [frmBoardDefects]. I have two cascading combo boxes named [cboDepartment]
and [Error_Code]. Currently I have this code in the after update event of
[cboDepartment]:
Private Sub DefectDepartment_AfterUpdate()
On Error Resume Next
Select Case DefectDepartment.Value
Case "AOI"
ErrorCode.RowSource = "LPCB"
Case "Bench"
ErrorCode.RowSource = "LPCB"
Case "Final"
ErrorCode.RowSource = "LPCB"
Case "In Process"
ErrorCode.RowSource = "LPCB"
Case "Box Build"
ErrorCode.RowSource = "LBoxBuild"
Case "Cable"
ErrorCode.RowSource = "LCable"
Case "FCT"
ErrorCode.RowSource = "LTest"
Case "ICT"
ErrorCode.RowSource = "LTest"
End Select
This seems to be working fine. What I would like to do is have the value in
the [Department] field carry over from [frmBoardInspection] and populate the
[Error_Code] field in [frmBoardDefects]. I'm not quite sure how to do this
because frmBoardDefects will not necessarily always be opened. I have tried
putting [Forms]![frmBoardInspection]![Department] into the default value of
the [Department] field in [frmBoardDefects]. This populates the [Department]
field but, does not populate the [Error_Code]. I'm not really sure how to
make this work right and I have a feeling my way of thinking is off. Any
insight would be very helpful!
Thanks
Courtney
Can't quite seem to get my arms around this one! I have two forms in my
database. The first is to track the inspection of PCB boards as they go
through the manufacturing process [frmBoardInspection]. The second form is to
record any defects found on the boards during inspection [frmBoardDefects].
[frmBoardInspection] has twelve fields where the user will enter data about
the inspection of a particular board. On that form there is a combo box named
[Department] that has a lookup to a table called [LDepartments]. The last
field on the form is a combo box called [Defects_Present]. This cbo also has
a lookup to a table. If the user chooses "no" defects then the record can be
saved and they can start a new record. If the user selects "Yes" to defects,
a command button to open [frmBoardDefects] is enabled. There are seven fields
in [frmBoardDefects]. I have two cascading combo boxes named [cboDepartment]
and [Error_Code]. Currently I have this code in the after update event of
[cboDepartment]:
Private Sub DefectDepartment_AfterUpdate()
On Error Resume Next
Select Case DefectDepartment.Value
Case "AOI"
ErrorCode.RowSource = "LPCB"
Case "Bench"
ErrorCode.RowSource = "LPCB"
Case "Final"
ErrorCode.RowSource = "LPCB"
Case "In Process"
ErrorCode.RowSource = "LPCB"
Case "Box Build"
ErrorCode.RowSource = "LBoxBuild"
Case "Cable"
ErrorCode.RowSource = "LCable"
Case "FCT"
ErrorCode.RowSource = "LTest"
Case "ICT"
ErrorCode.RowSource = "LTest"
End Select
This seems to be working fine. What I would like to do is have the value in
the [Department] field carry over from [frmBoardInspection] and populate the
[Error_Code] field in [frmBoardDefects]. I'm not quite sure how to do this
because frmBoardDefects will not necessarily always be opened. I have tried
putting [Forms]![frmBoardInspection]![Department] into the default value of
the [Department] field in [frmBoardDefects]. This populates the [Department]
field but, does not populate the [Error_Code]. I'm not really sure how to
make this work right and I have a feeling my way of thinking is off. Any
insight would be very helpful!
Thanks
Courtney