VB code does not work in VBA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm using Accesss 2000 and trying to make use of some VB code to do file
searches. I understood that the VBA in Access 2000 was the full VB but I'm
getting syntax errors on these statements:

Event SearchStatus(ByVal CurrentFolder As String, Cancel As Boolean)
Event Found(ByVal FileInfo As File)
RaiseEvent SearchStatus(strPath, blnCancel)
RaiseEvent Found(clsFile)
 
Hi,
I know you can do this in 2002.
How are you using this code?
This is inside a class module right?
 
VBA in Access and VB6 are very similar, but there are differences. Try the
F1 help for Event and see what you get. Also one of your arguments is current
folder. Look into the file system object and see if you can accomplish what
you intend with it.

For starters your code doesn't use an identifier try
Public Event SearchStatus(ByVal CurrentFolder As String, Cancel As Boolean)

You also have to put this code in an Access class module. I could not get
Access 2000 to accept the code in a regular code module.

Two annoying differences for me is the inability to set top and left on
forms and I can't use the VB6 clipboard object in Access. One function I wish
VB6 had is Nz for converting nulls.

If you are new to coding in Access do a search in this newsgroup on
corrupted database. Backing up is import in VB6, it's critical in Access! If
you don't do a daily backup and compact and repair in Access while you are
developing you are going to lose a lot of work someday.

Mark
 
Back
Top