Duane Hookom HD - QBF

  • Thread starter Thread starter ron
  • Start date Start date
R

ron

Hi Duane

I downloaded your HD-QBF as a separate database it runs perfect.

when I import as external data, all the files as mentioned in your
startform, into my own database
it gives an error in visual basic about DAO

such as DIM db.as DAO.DATABASE

what is going wrong ?

Thanks inadvance for your help

Ron
 
Sounds like you're using ACCESS 2000 or ACCESS 2002 for your database. These
versions do not set a reference to the DAO library by default -- you'll need
to do that manually. Open the VBE, click Tools | References, and select Data
Access Object library 3.x from the list.
 
Just to help find it, the reference for which you're looking should be
"Microsoft DAO 3.6 Object Library".
 
Thanks guys...

--
Duane Hookom
MS Access MVP

Douglas J. Steele said:
Just to help find it, the reference for which you're looking should be
"Microsoft DAO 3.6 Object Library".
 
Sorry Still a problem


The querybuilder goes wrong with European Date and US Date
1-6-06 is June 1st - 2006 in my Database
The query Builder shows all record of January 6th 2006
what do I have to change in the VB code ?
Thanks for quick reply

Ron
 
Hi Duane

found Allan's function


Function SQLDate(varDate As Variant) As String
'Purpose: Return a delimited string in the date format used
natively by JET SQL.
'Argument: A date/time value.
'Note: Returns just the date format if the argument has no
time component,
' or a date/time format if it does.
'Author: Allen Browne. (e-mail address removed), June 2006.
If IsDate(varDate) Then
If DateValue(varDate) = varDate Then
SQLDate = Format$(varDate, "\#mm\/dd\/yyyy\#")
Else
SQLDate = Format$(varDate, "\#mm\/dd\/yyyy hh\:nn\:ss\#")
End If
End If
End Function

tried to implement it into VB code without succes
For the moment I type the dates manually, first month and than date and
year than it works.

Any suggestion where to put it?

Best regards
Ron
 
It's a function: put it into a module (not code associated with a form or
report, nor in a class module). Make sure you do not name the module
SQLDate: modules cannot have the same name as functions or subs.
 
Back
Top