Hi,
I have an Access 97 form that uses a query (made up of two tables) as its record source.
I am using the following code within an after update event to populate the form with the correct record after a user enters a social security njumber:
The problem is that just after the filter command, a new record is created in the main table of the underlying query, with justone field (the social security field) getting populated. The form, however, does properly filter to the correct record.
If I am making sense, anyone know why a new record (with just one field populated) is being created each time I filter a form?
Thanks,
JBG
I have an Access 97 form that uses a query (made up of two tables) as its record source.
I am using the following code within an after update event to populate the form with the correct record after a user enters a social security njumber:
Code:
varResult = DLookup("[ipkT801ID]", "tblT801", "[txtSSN] = '" & Me.txtSSNform & "' AND txtOmniID = '" & Me.cboFindPlan.Column(0) & "'")
If Not IsNull(varResult) Then
Me.Filter = "[ipkT801ID] = " & varResult
Me.FilterOn = True
Me.cmdEdit.Enabled = True
Me.cmdAdd.Enabled = True
Me.cmdEdit.SetFocus
Else
me.cmdAdd.Enabled = True
Me.cmdEdit.Enabled = False
Me.cmdAdd.SetFocus
End If
The problem is that just after the filter command, a new record is created in the main table of the underlying query, with justone field (the social security field) getting populated. The form, however, does properly filter to the correct record.
If I am making sense, anyone know why a new record (with just one field populated) is being created each time I filter a form?
Thanks,
JBG