I get an "Compile error: Can't find project or library"
[DATE]= #" & Format(Me![Combo67], "MM/DD/YY") & "#;"
The word format is highlighted as the problem. I think the code worked OK
on Access97, but no longer works now I have upgraded to Access 2003.
Advice appreciated
thanks
Peter
The whole event is shown below:
Private Sub Combo67_BeforeUpdate(Cancel As Integer)
Dim SQLStmt, R As Recordset
SQLStmt = "SELECT DISTINCT [DATE] FROM [AIRCRAFT REGISTRATIONS] WHERE
[AIRCRAFT REGISTRATIONS].[DATE] IS NOT NULL;"
Me![LOCATION].RowSource = SQLStmt
Me![LOCATION].Requery
Set R = CurrentDb.OpenRecordset(SQLStmt)
SQLStmt = "SELECT DISTINCT [LOCATION] FROM [AIRCRAFT REGISTRATIONS] WHERE
[AIRCRAFT REGISTRATIONS].[LOCATION] IS NOT NULL AND [AIRCRAFT
REGISTRATIONS].[DATE]= #" & Format(Me![Combo67], "MM/DD/YY") & "#;"
Me![LOCATION].RowSource = SQLStmt
Me![LOCATION].Requery
Set R = CurrentDb.OpenRecordset(SQLStmt)
If R.RecordCount > 0 Then
R.MoveLast
If R.RecordCount = 1 Then
Me![LOCATION] = R![LOCATION]
End If
End If
End Sub