Zydeceltico
Registered User.
- Local time
- Yesterday, 21:30
- Joined
- Dec 5, 2017
- Messages
- 843
Hi All -
I have a form (frmMillInspection) that has a combobox (cboPartNumber) where the user picks a Part Number. I also have a text box (txtPartDrawing). When the user makes a selection in cboPartNumber, txtPartDrawing is populated with the part drawing. (I should note that one must also choose the Plant Name and the Workstation first before making a selection in Part Number as they all cascade on each other).
The data for PartNumber and PartDrawing both reside in tblPartDrawings.
I have the following fields in tblPartsDrawing in this order: Part_ID(PK), PartNumber, Workstation_FK, DWGType, and PartDWG.
cboPartNumber is populated from the field PartType and txtPartDrawing is populated from field PartDWG.
cboPartNumber stipulates a column count of 3; Column Widths = 0;0.7875;0
The code for the On Change event on cboPartNumber is:
Private Sub cboPartNumber_Change()
Me!txtPartDrawing = Me!cboPartNumber.Column(2)
End Sub
....and this works as intended.
Now my question:
I have another form (frmWeldAssembleInspection) which has a similar condition based on tblWeldAssemble. On form frmWeldAssembleInspection I have cboAssemblyNumber and txtStandardDrawing. Making a selection in cboAssemblyNumber should populate txtStandardDrawing. The data for cboAssemblyNumber is the 2nd column in tblAssemblyTypes and txtStandardDrawings should populate from the 3rd column (AssemblyDWG) in tblAssemblyTypes.
I have the column count for cboAssemblyNumber set to "3." The column width is set to 0.7875";0" - which returns the correct values to cboAssemblyNumber although I do not know why. It does not follow the logic that I thought it would.
The code I have inserted on the Change event for cboAssemblyNumber is:
Private Sub cboAssemblyNumber_Change()
Me!txtStandardDrawing = Me!cboAssemblyNumber.Column(2)
End Sub
This does not return anything to txtStandardDrawing.
Also, I do not understand why the column width being set to 0.7875";0" returns the correct data for the drop down selections in cboAssemblyNumber as I have only stipulated an "open" width for the first column which I *thought* would have been the PK in tblAssemblyTypes rather than the second field which is AssemblyType.
I have tried various numbers (0-3) in Me!cboAssemblyNumber.Column(#) to no avail. If I add a 0; at the beginning of the current (and working) 0.7875";0" nothing is returned to cboAssemblyNumber. I would have expected that 0";0.7875";0" would have been the correct input for column width but it doesn't work.
I would love to have an explanation of how Column Count and Column Width are intended to operate - as well as some guidance on why my first condition works and my second doesn't.
Thank you in advance,
Tim
I have a form (frmMillInspection) that has a combobox (cboPartNumber) where the user picks a Part Number. I also have a text box (txtPartDrawing). When the user makes a selection in cboPartNumber, txtPartDrawing is populated with the part drawing. (I should note that one must also choose the Plant Name and the Workstation first before making a selection in Part Number as they all cascade on each other).
The data for PartNumber and PartDrawing both reside in tblPartDrawings.
I have the following fields in tblPartsDrawing in this order: Part_ID(PK), PartNumber, Workstation_FK, DWGType, and PartDWG.
cboPartNumber is populated from the field PartType and txtPartDrawing is populated from field PartDWG.
cboPartNumber stipulates a column count of 3; Column Widths = 0;0.7875;0
The code for the On Change event on cboPartNumber is:
Private Sub cboPartNumber_Change()
Me!txtPartDrawing = Me!cboPartNumber.Column(2)
End Sub
....and this works as intended.
Now my question:
I have another form (frmWeldAssembleInspection) which has a similar condition based on tblWeldAssemble. On form frmWeldAssembleInspection I have cboAssemblyNumber and txtStandardDrawing. Making a selection in cboAssemblyNumber should populate txtStandardDrawing. The data for cboAssemblyNumber is the 2nd column in tblAssemblyTypes and txtStandardDrawings should populate from the 3rd column (AssemblyDWG) in tblAssemblyTypes.
I have the column count for cboAssemblyNumber set to "3." The column width is set to 0.7875";0" - which returns the correct values to cboAssemblyNumber although I do not know why. It does not follow the logic that I thought it would.
The code I have inserted on the Change event for cboAssemblyNumber is:
Private Sub cboAssemblyNumber_Change()
Me!txtStandardDrawing = Me!cboAssemblyNumber.Column(2)
End Sub
This does not return anything to txtStandardDrawing.
Also, I do not understand why the column width being set to 0.7875";0" returns the correct data for the drop down selections in cboAssemblyNumber as I have only stipulated an "open" width for the first column which I *thought* would have been the PK in tblAssemblyTypes rather than the second field which is AssemblyType.
I have tried various numbers (0-3) in Me!cboAssemblyNumber.Column(#) to no avail. If I add a 0; at the beginning of the current (and working) 0.7875";0" nothing is returned to cboAssemblyNumber. I would have expected that 0";0.7875";0" would have been the correct input for column width but it doesn't work.
I would love to have an explanation of how Column Count and Column Width are intended to operate - as well as some guidance on why my first condition works and my second doesn't.
Thank you in advance,
Tim
Attachments
Last edited: