Here is the code for the command button, notice it is a select case that really only has one case right now but will get more.
{Code}
Private Sub cmdPrint_Click()
On Error GoTo Err_cmdPrint_Click
Dim stDocName As String
Dim stLinkCriteria As String
Select Case Me.cboPrintSelect
Case "Condition Tag"
stDocName = "FRM1574Tag"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Forms!FRM1574Tag.PartNumber1 = Me.PartNumber.Column(1)
Forms!FRM1574Tag.StockNumber1 = Me.StockNumber.Column(1)
Forms!FRM1574Tag.Nomenclature1 = Me.Nomenclature.Column(1)
Forms!FRM1574Tag.SerialNumber1 = Me.SerialNumber
Forms!FRM1574Tag.DocumentNumber1 = Me.DocumentNumber
Forms!FRM1574Tag.cboSelectTag = Me!sfrmCurrentStatus.Form!txtCurrentStatus
Case "350 Tag"
Case "Turnover"
End Select
Exit_cmdPrint_Click:
Exit Sub
Err_cmdPrint_Click:
MsgBox Err.Description
Resume Exit_cmdPrint_Click
End Sub
{/Code}
Here is the code in the public module
{Code}
Public Sub Update1574Tag()
Select Case Forms!FRM1574Tag.cboSelectTag
Case "COM"
Forms!FRM1574Tag.Block1.BackColor = 65535
Forms!FRM1574Tag.Block2.BackColor = 65535
Forms!FRM1574Tag.txtTitle = "SERVICEABLE TAG - MATERIAL"
Forms!FRM1574Tag.txtCondition1 = "A"
Forms!FRM1574Tag.txtLine1 = "NEXT INSPECTION" & vbCrLf & "DUE/OVERAGE DATE"
Forms!FRM1574Tag.txtLine2 = "INSPECTION ACTIVITY" & vbCrLf & "60TH CMS, TRAVIS AFB, CA"
Case "NRTS-1"
Forms!FRM1574Tag.Block1.BackColor = 6723891
Forms!FRM1574Tag.Block2.BackColor = 6723891
Forms!FRM1574Tag.txtTitle = "UNSERVICEABLE (REPAIRABLE) TAG-MATERIAL"
Forms!FRM1574Tag.txtCondition1 = "F"
Forms!FRM1574Tag.txtLine1 = "INSPECTION ACTIVITY" & vbCrLf & "60TH CMS, TRAVIS AFB, CA"
Forms!FRM1574Tag.txtLine2 = "REASON OR AUTHORITY" & vbCrLf & "NRTS-1"
Case "NRTS-2"
Forms!FRM1574Tag.Block1.BackColor = 6723891
Forms!FRM1574Tag.Block2.BackColor = 6723891
Forms!FRM1574Tag.txtTitle = "UNSERVICEABLE (REPAIRABLE) TAG-MATERIAL"
Forms!FRM1574Tag.txtCondition1 = "F"
Forms!FRM1574Tag.txtLine1 = "INSPECTION ACTIVITY" & vbCrLf & "60TH CMS, TRAVIS AFB, CA"
Forms!FRM1574Tag.txtLine2 = "REASON OR AUTHORITY" & vbCrLf & "NRTS-2"
Case "NRTS-3"
Forms!FRM1574Tag.Block1.BackColor = 6723891
Forms!FRM1574Tag.Block2.BackColor = 6723891
Forms!FRM1574Tag.txtTitle = "UNSERVICEABLE (REPAIRABLE) TAG-MATERIAL"
Forms!FRM1574Tag.txtCondition1 = "F"
Forms!FRM1574Tag.txtLine1 = "INSPECTION ACTIVITY" & vbCrLf & "60TH CMS, TRAVIS AFB, CA"
Forms!FRM1574Tag.txtLine2 = "REASON OR AUTHORITY" & vbCrLf & "NRTS-3"
Case "NRTS-4"
Forms!FRM1574Tag.Block1.BackColor = 6723891
Forms!FRM1574Tag.Block2.BackColor = 6723891
Forms!FRM1574Tag.txtTitle = "UNSERVICEABLE (REPAIRABLE) TAG-MATERIAL"
Forms!FRM1574Tag.txtCondition1 = "F"
Forms!FRM1574Tag.txtLine1 = "INSPECTION ACTIVITY" & vbCrLf & "60TH CMS, TRAVIS AFB, CA"
Forms!FRM1574Tag.txtLine2 = "REASON OR AUTHORITY" & vbCrLf & "NRTS-4"
Case "NRTS-5"
Forms!FRM1574Tag.Block1.BackColor = 6723891
Forms!FRM1574Tag.Block2.BackColor = 6723891
Forms!FRM1574Tag.txtTitle = "UNSERVICEABLE (REPAIRABLE) TAG-MATERIAL"
Forms!FRM1574Tag.txtCondition1 = "F"
Forms!FRM1574Tag.txtLine1 = "INSPECTION ACTIVITY" & vbCrLf & "60TH CMS, TRAVIS AFB, CA"
Forms!FRM1574Tag.txtLine2 = "REASON OR AUTHORITY" & vbCrLf & "NRTS-5"
Case "NRTS-6"
Forms!FRM1574Tag.Block1.BackColor = 6723891
Forms!FRM1574Tag.Block2.BackColor = 6723891
Forms!FRM1574Tag.txtTitle = "UNSERVICEABLE (REPAIRABLE) TAG-MATERIAL"
Forms!FRM1574Tag.txtCondition1 = "F"
Forms!FRM1574Tag.txtLine1 = "INSPECTION ACTIVITY" & vbCrLf & "60TH CMS, TRAVIS AFB, CA"
Forms!FRM1574Tag.txtLine2 = "REASON OR AUTHORITY" & vbCrLf & "NRTS-6"
Case "NRTS-7"
Forms!FRM1574Tag.Block1.BackColor = 6723891
Forms!FRM1574Tag.Block2.BackColor = 6723891
Forms!FRM1574Tag.txtTitle = "UNSERVICEABLE (REPAIRABLE) TAG-MATERIAL"
Forms!FRM1574Tag.txtCondition1 = "F"
Forms!FRM1574Tag.txtLine1 = "INSPECTION ACTIVITY" & vbCrLf & "60TH CMS, TRAVIS AFB, CA"
Forms!FRM1574Tag.txtLine2 = "REASON OR AUTHORITY" & vbCrLf & "NRTS-7"
Case "NRTS-8"
Forms!FRM1574Tag.Block1.BackColor = 6723891
Forms!FRM1574Tag.Block2.BackColor = 6723891
Forms!FRM1574Tag.txtTitle = "UNSERVICEABLE (REPAIRABLE) TAG-MATERIAL"
Forms!FRM1574Tag.txtCondition1 = "F"
Forms!FRM1574Tag.txtLine1 = "INSPECTION ACTIVITY" & vbCrLf & "60TH CMS, TRAVIS AFB, CA"
Forms!FRM1574Tag.txtLine2 = "REASON OR AUTHORITY" & vbCrLf & "NRTS-8"
Case "NRTS-9"
Forms!FRM1574Tag.Block1.BackColor = 255
Forms!FRM1574Tag.Block2.BackColor = 255
Forms!FRM1574Tag.txtTitle = "UNSERVICEABLE (CONDEMNED) TAG-MATERIAL"
Forms!FRM1574Tag.txtCondition1 = "H"
Forms!FRM1574Tag.txtLine1 = "INSPECTION ACTIVITY" & vbCrLf & "60TH CMS, TRAVIS AFB, CA"
Forms!FRM1574Tag.txtLine2 = "REASON OR AUTHORITY" & vbCrLf & "NRTS-9"
End Select
End Sub
{/Code}
Just so you know this is to show/print a tag and it will be used from different forms and with data from different tables. I also want the user to be able to manually type the required information if the form is opened with no values passed. That is the reason I am attempting to do this the way I am.
Thanks