I have a form with 10 combo boxes for 10 possible fields in a lot number. The following is the code for the first combo box. Is there a way around coding all of this for each combo box? The combo box is bound to a table of lot number fields. Once the fields are selected, I string them all together to create the lot number text that is bound to the lot number field. The reason I'm doing this is because a manager creates the lot numbers exept for the fields that operators have to fill in such as shift, etc. If anyone knows a better way, I'd appreciate it if you would point me in the right direction.
Select Case cmbField1
Case 1
txtField1.Value = Format(Format(Date, "yy"), "0")
Case 2
txtField1.Value = Format(Format(Date, "y"), "000")
Case 3
txtField1.Value = "S"
Case 4
txtField1.Value = " "
txtField1.SetFocus
txtField1.SelLength = Len(txtField4)
txtField1Prompt.Value = "<----Enter shift A, B, or C"
Case 5
txtField1.Value = " "
Case 6
txtField1.Value = " "
Case 7
txtField1.Value = "G2"
Case 8
txtField1.Value = DatePart("m", Date)
Case 9
txtField1.Value = DatePart("d", Date)
Case 10
txtField1.Value = Format(Format(Date, "yy"), "0")
End Select
Select Case cmbField1
Case 1
txtField1.Value = Format(Format(Date, "yy"), "0")
Case 2
txtField1.Value = Format(Format(Date, "y"), "000")
Case 3
txtField1.Value = "S"
Case 4
txtField1.Value = " "
txtField1.SetFocus
txtField1.SelLength = Len(txtField4)
txtField1Prompt.Value = "<----Enter shift A, B, or C"
Case 5
txtField1.Value = " "
Case 6
txtField1.Value = " "
Case 7
txtField1.Value = "G2"
Case 8
txtField1.Value = DatePart("m", Date)
Case 9
txtField1.Value = DatePart("d", Date)
Case 10
txtField1.Value = Format(Format(Date, "yy"), "0")
End Select