By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,098 Members | 1,255 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,098 IT Pros & Developers. It's quick & easy.

Dates in Visual Basic Access 2003

P: n/a
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
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Peter wrote:
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,


Peter, did you convert from A97? I've encountered this a couple of
times converting my A97 apps and you need to fool around with references
a bit. I can't quite recall which I turned off and then back on again,
but that solved my problem.

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.