Referencing a library problem

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

Guest

Using Microsoft Access 2k3
Database is Access 2k format
Have tryed converting it to 2k3 but still same problem
I downloaded the Members database file 01018584.mdb from microsoft. I liked
the features of the database and started to expand on it to fit my criteria.
I created a new form and want to add a autofill of the current system date so
I used this code.
Private Sub SideBody_GotFocus()
Me![BreakDate] = Date
End Sub

When I click on the combo box I get the following
Run-time error '2465'
Microsoft can't find the field 'Date' refferred to in your expression

I don't understand why because the form-Member Payments, uses this code also
and it works fine. So I highlighted and clicked on Definition and received
this message.
Cannot jump to 'Date' because it is in the library 'C:\Documents and
Settings\Default\My Documents\01018584.mdb" which is not currently referenced

The library VBA is already referenced. The other form Member Payments, if
you do the same it opens the object browser to VBA,DateTime,Date. I can not
seem to find a way to fix this. The Time Function and Now Function work fine
but I wish to used the Date Function and why it is not working when it is
already referenced it beyond me. Any help would be useful. Thanx
 
Do you have anything named Date anywhere in your database? (A variable, a
control, a field, a function, etc.) Date is a reserved word, and you should
never use it for anything other than the built-in function.

If that's not the case, your References may still be messed up. This can be
caused by differences in either the location or file version of certain
files between the machine where the application was developed, and where
it's being run (or the file missing completely from the target machine).
Such differences are common when new software is installed.

On the machine(s) where it's not working, open any code module (or open the
Debug Window, using Ctrl-G, provided you haven't selected the "keep debug
window on top" option). Select Tools | References from the menu bar. Examine
all of the selected references.

If any of the selected references have "MISSING:" in front of them, unselect
them, and back out of the dialog. If you really need the reference(s) you
just unselected (you can tell by doing a Compile All Modules), go back in
and reselect them.

If none have "MISSING:", select an additional reference at random, back out
of the dialog, then go back in and unselect the reference you just added. If
that doesn't solve the problem, try to unselect as many of the selected
references as you can (Access may not let you unselect them all), back out
of the dialog, then go back in and reselect the references you just
unselected. (NOTE: write down what the references are before you delete
them, because they'll be in a different order when you go back in)


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



default105 said:
Using Microsoft Access 2k3
Database is Access 2k format
Have tryed converting it to 2k3 but still same problem
I downloaded the Members database file 01018584.mdb from microsoft. I
liked
the features of the database and started to expand on it to fit my
criteria.
I created a new form and want to add a autofill of the current system date
so
I used this code.
Private Sub SideBody_GotFocus()
Me![BreakDate] = Date
End Sub

When I click on the combo box I get the following
Run-time error '2465'
Microsoft can't find the field 'Date' refferred to in your expression

I don't understand why because the form-Member Payments, uses this code
also
and it works fine. So I highlighted and clicked on Definition and
received
this message.
Cannot jump to 'Date' because it is in the library 'C:\Documents and
Settings\Default\My Documents\01018584.mdb" which is not currently
referenced

The library VBA is already referenced. The other form Member Payments, if
you do the same it opens the object browser to VBA,DateTime,Date. I can
not
seem to find a way to fix this. The Time Function and Now Function work
fine
but I wish to used the Date Function and why it is not working when it is
already referenced it beyond me. Any help would be useful. Thanx
 
Mr. Steele,
Thanks for your prompt reply but I had already found that possible solution
in the knowledge base. I had no MISSING statements in references and no
other fields named DATE. I did find that the form was somehow corrupt, I
created a new form from the same table and copied the code from the bad one
to the new form and everything works fine. I don't know why but I sure
wished I would have tried this earlier. Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top