Code: Select all
Private Sub Combo69_AfterUpdate()
Dim strwhere As String
Dim qualrec As Variant
Dim frmcomvolrepresent As String
On Error GoTo err1
QualRecExists = "f"
Text64.Visible = True
Me.Requery
Me.Repaint
DoCmd.GoToControl "Text64"
DoCmd.FindRecord CLng(Combo69.Column(4)), acEntire, , acSearchAll, True, acCurrent
[badge Number] = Combo69.Column(4)
'Text64 = Combo69.Column(3)
Text67 = Combo69.Column(1)
Text66 = Combo69.Column(2)
frm256ErrorMsg = ""
frm256ErrorMsg = ""
strwhere = "[tbl330badgenbr] = " & Combo69.Column(4)
qualrec = DLookup("[tbl330badgeNbr]", "ShopQualification", strwhere)
If IsNull(qualrec) Or IsEmpty(qualrec) Then
' create a ShopQualification record for this badge nbr
Dim dbsHappyFactory As Database
Dim rstShopQualification As Recordset
Set dbsHappyFactory = CurrentDb()
Set rstShopQualification = dbsHappyFactory.OpenRecordset("ShopQualification", dbOpenDynaset)
With rstShopQualification
.AddNew
![tbl330BadgeNbr] = Combo69.Column(4)
.Update
.Bookmark = .LastModified
End With
Me.Requery
Me.Repaint
End If
If Check86 = True Then
If IsNull(frmcomvolrepresent) Or IsEmpty(frmcomvolrepresent) Then
Check72 = True
Else
Check87 = True
End If
Check86 = False
End If
err1:
Debug.Print Err.Number; Err.Description
End Sub
Details:
Text64 is a bound field pointing to an autonumber field in the People Table.
Combo69.column (4) is the id number of the record in the People Table.
Any thoughts? The randomness is puzzling.
TIA.