Imdabaum
10-09-2006, 12:16 PM
We just had some issues where some data was getting asigned to different owner. I traced the code that performs the lookups and fills the form and this is what I found.
Public Sub SetIssues()
If Not IsNull(Me.txtPropertyID.Value) Then
Dim oRecordset As Recordset
Set oRecordset = CurrentDb().OpenRecordset("SELECT issues FROM tblissues WHERE issues_date = (SELECT max(issues_date) FROM tblissues WHERE propertyID = " & Me.txtPropertyID.Value & ")")
cboIssues.Value = ""
If Not oRecordset.EOF Then
cboIssues.Value = oRecordset!issues
End If
oRecordset.Close
End If
End Sub
This looks fine and dandy until you look at the table. I've enclosed a screen shot for your enjoyment.
4006
If you'll notice there is no field for propertyid....
First question is How did that ever work?
(Dumb question)If it worked before any suggestions on how it broke? All code and tables have the same design.
Public Sub SetIssues()
If Not IsNull(Me.txtPropertyID.Value) Then
Dim oRecordset As Recordset
Set oRecordset = CurrentDb().OpenRecordset("SELECT issues FROM tblissues WHERE issues_date = (SELECT max(issues_date) FROM tblissues WHERE propertyID = " & Me.txtPropertyID.Value & ")")
cboIssues.Value = ""
If Not oRecordset.EOF Then
cboIssues.Value = oRecordset!issues
End If
oRecordset.Close
End If
End Sub
This looks fine and dandy until you look at the table. I've enclosed a screen shot for your enjoyment.
4006
If you'll notice there is no field for propertyid....
First question is How did that ever work?
(Dumb question)If it worked before any suggestions on how it broke? All code and tables have the same design.