Hello,
I have a form which you can sign in and out tags. I have pre populated the table with all the tag numbers we have (000 to 175) (Picture 1 bottom of page).
When you sign out a Tag you are required to enter 5 fields minimum (Tag Number{Tag Num is a combo box of all the pre populated tag numbers}, Description, Location(board/Kit#), Date Out and Who Signed it out). This works fine most of the time.
When you Sign in a Tag you select a tag number from a combo box that only shows signed out tags. In my VB code i run a "append query" to copy the record to a history table and then i set all fields except the tag number back to "" (at the bottom of the code below)
Code:
' Save And Exit Button
Private Sub SaveExit_Click()
If Me.SignInOut.Value = 1 And Me.Combo120.ListIndex = -1 Then 'signout button and signout dropdown box
MsgBox "Please Select a Deployed Tag Number"
Me.Combo120.SetFocus
Exit Sub
ElseIf Me.SignInOut.Value = 2 And Me.Combo231.ListIndex = -1 Then 'SignIn button and signin dropdown box
MsgBox "Please Select a Deployed Tag Number"
Me.Combo231.SetFocus
Exit Sub
ElseIf Me.SignInOut.Value = 1 And IsNull(Description) Then 'SignOut button and No Description
MsgBox "Please Enter What the Item is."
Me.Description.SetFocus
Exit Sub
ElseIf Me.SignInOut.Value = 1 And IsNull(Location) Then 'SignOut button and No Location
MsgBox "Please Enter the Tool Board/Kit Number the Item is held in."
Me.Location.SetFocus
Exit Sub
ElseIf Me.SignInOut.Value = 1 And IsNull(DateBy) Then 'SignOut button and No Date
MsgBox "Please Enter when the tag was Signed Out."
Me.DateBy.SetFocus
Exit Sub
ElseIf Me.SignInOut.Value = 1 And IsNull(SignedBy) Then 'SignOut button and No Name
MsgBox "Please Enter Who Signed the Tag Out."
Me.SignedBy.SetFocus
Exit Sub
ElseIf Me.SignInOut.Value = 2 And IsNull(DateBy) Then 'SignIn Button and No Date
MsgBox "Please Enter when the tag was Signed Out."
Me.DateBy.SetFocus
Exit Sub
ElseIf Me.SignInOut.Value = 2 And IsNull(SignedBy) Then 'SignIn button and No Name
MsgBox "Please Enter Who Signed the Tag Out."
Me.SignedBy.SetFocus
Exit Sub
ElseIf Me.SignInOut.Value = 1 Then ' Sign Out
Me.SignedOut.Value = "Yes"
Me.DateBy = Me.DateOut
Me.SignedOutBy = Me.SignedBy
DoCmd.Close
ElseIf Me.SignInOut.Value = 2 Then ' Sign in
Me.DateIn = Me.DateBy
Me.SignedInBy = Me.SignedBy
DoCmd.RunCommand acCmdSaveRecord ' Saves record so Datein and SigninBy update on table
DoCmd.SetWarnings False
DoCmd.OpenQuery "AppendDepTagInQ" ' Copies record to history
DoCmd.SetWarnings True
' Erases the Info in the Record but keeps the Tag Number after the record has been copied to TemmisTagHistoryT
Me.SignedOut.Value = "no"
Me.Combo120.Value = ""
Me.TemmisNum.Value = ""
Me.NSN.Value = ""
Me.Description.Value = ""
Me.SerialNum.Value = ""
Me.Location.Value = ""
Me.Notes.Value = ""
Me.PartNum.Value = ""
Me.DateBy.Value = ""
Me.SignedBy.Value = ""
Me.SignedOutBy.Value = ""
Me.DateOut.Value = ""
DoCmd.Close
End If
End Sub
Now my issue is that for some reason after a tag has been signed out and then back in If you go to sign out that same tag again it bypasses Description, Location and Sing out by fields. So some one can select a tag enter the date and it will save with only that info.
