PC Review


Reply
Thread Tools Rate Thread

CurrenDB.Name does not work in Access 2003?

 
 
FUBARinSFO
Guest
Posts: n/a
 
      23rd Jul 2010
Hi:

Desigining a footer in Access 2003 report, I've worked out with VBA to
put fully-qualified path and file name in the footer, along with the
name of the data table it is referencing (code below).

This does not use the '=CurrentDb.Name' suggested by a number of
postings in this group. When I place '=CurrentDb.Name' in a text box
(which changes to '[currentdb].[Name]' and run the report, I get a
text input box "Enter Parameter Value" for 'currentdb'.

Clearly it does not recognize the built-in variable 'CurrentDb' Why
is that?

Thank you in advance for your help.

-- Roy Zider

This is VBA code:
-------------------------------------------
Option Compare Database

Function MyPath() As String
' 7/22/2010 lsz
' this gives full dpfname

MyPath = CurrentProject.FullName

End Function
-------------------------------------------

This is in text box on page footer:
-----------------------------------------------

=MyPath() & " [" & [Name] & "]"
-----------------------------------------------

System information on Microsoft Access 2003
-------------------------------------------------------------------
Application name Microsoft Access
Version 11.0
Build 8166
Product ID 73931-640-4055412-57901
Application path C:\Program Files\Microsoft Office\OFFICE11\
Language English (United States)
ADO version 2.8
VBA version 6.05
References VBA, Access, stdole, DAO, ADODB
Database name dbVO23.mdb
Database path D:\D\DandS\BitBucket\MyDox\_OWL\Accounting 2\Dox\2.
Verified Objections
Database size 1268.0 KB
Database create date 7/19/2010 20:15:58
Current user Admin
Jet version 4.0
 
Reply With Quote
 
 
 
 
FUBARinSFO
Guest
Posts: n/a
 
      23rd Jul 2010
Allen:

Evidently not.

Using your expresson ' =[CurrentProject].[FullName]' in the Data/
Control Source box of the text box properties sheet throws error

"Syntax error in query expression 'First([=[CurrentProject]].
[FullName])'.

Stripping the brackets and using '=CurrentProject.FullName', it throws
an Enter Parameter Value input box with the full string
'CurrentProject.FullName', so it doesn't recognize either of these
vars.

-- Roy



 
Reply With Quote
 
David W. Fenton
Guest
Posts: n/a
 
      23rd Jul 2010
FUBARinSFO <(E-Mail Removed)> wrote in
news:08509f32-689f-46b1-83c5-(E-Mail Removed)
m:

> Evidently not.
>
> Using your expresson ' =[CurrentProject].[FullName]' in the Data/
> Control Source box of the text box properties sheet throws error
>
> "Syntax error in query expression 'First([=[CurrentProject]].
> [FullName])'.
>
> Stripping the brackets and using '=CurrentProject.FullName', it
> throws an Enter Parameter Value input box with the full string
> 'CurrentProject.FullName', so it doesn't recognize either of these
> vars.


What about qualifying it properly:

Application.CurrentDB.Name
Appication.CurrentProject.FullName

If that doesn't work, I guess you'll have to write a UDF wrapper
around one or the other of them.

Bummer. There's been a slow decay in the scope of the expression
service starting with A2000, and this looks like yet another example
if the fully-specified versions don't work.

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/
 
Reply With Quote
 
Access Developer
Guest
Posts: n/a
 
      24th Jul 2010
Interesting... I just tried =CurrentDB.Name as the Control Source of a Text
Box in the Report Footer of a Report in Access 2003. It did add brackets to
the Control Source, =[CurrentDB].[Name], but returned the fully qualified
name of the current database. Moving that Text Box to the Report's Page
Footer also worked just fine.

I'm wondering, when you wrote about Access adding the brackets, you used an
all-lowercase currentdb rather than the CurrentDB you had typed earlier. If
it is changing the capitalization, you should make certain you haven't
defined a variable "currentdb" anywhere in your database.

--
Larry Linson, Microsoft Office Access MVP
Co-author: "Microsoft Access Small Business Solutions", published by Wiley
Access newsgroup support is alive and well in USENET
comp.databases.ms-access


"FUBARinSFO" <(E-Mail Removed)> wrote in message
news:92831b70-0e4f-4094-9e0d-(E-Mail Removed)...
> Hi:
>
> Desigining a footer in Access 2003 report, I've worked out with VBA to
> put fully-qualified path and file name in the footer, along with the
> name of the data table it is referencing (code below).
>
> This does not use the '=CurrentDb.Name' suggested by a number of
> postings in this group. When I place '=CurrentDb.Name' in a text box
> (which changes to '[currentdb].[Name]' and run the report, I get a
> text input box "Enter Parameter Value" for 'currentdb'.
>
> Clearly it does not recognize the built-in variable 'CurrentDb' Why
> is that?
>
> Thank you in advance for your help.
>
> -- Roy Zider
>
> This is VBA code:
> -------------------------------------------
> Option Compare Database
>
> Function MyPath() As String
> ' 7/22/2010 lsz
> ' this gives full dpfname
>
> MyPath = CurrentProject.FullName
>
> End Function
> -------------------------------------------
>
> This is in text box on page footer:
> -----------------------------------------------
>
> =MyPath() & " [" & [Name] & "]"
> -----------------------------------------------
>
> System information on Microsoft Access 2003
> -------------------------------------------------------------------
> Application name Microsoft Access
> Version 11.0
> Build 8166
> Product ID 73931-640-4055412-57901
> Application path C:\Program Files\Microsoft Office\OFFICE11\
> Language English (United States)
> ADO version 2.8
> VBA version 6.05
> References VBA, Access, stdole, DAO, ADODB
> Database name dbVO23.mdb
> Database path D:\D\DandS\BitBucket\MyDox\_OWL\Accounting 2\Dox\2.
> Verified Objections
> Database size 1268.0 KB
> Database create date 7/19/2010 20:15:58
> Current user Admin
> Jet version 4.0



 
Reply With Quote
 
New Member
Join Date: Aug 2011
Posts: 1
 
      10th Aug 2011
I think this may be partly an OS issue... just fixed it in an Access 2003 app we've had running for years under XP with no problems using CurrentDB.Name on a report header. I just started getting the parameter input box running the app under Win 7, where of course I also have Access 2010 installed and thus get weird behavior (including what I like to call the "preparing to install" virus every time I switch from 2003 to 2010 or back...). I had to change to CurrentProject.Name to get it to work under Win 7. Hmmm...
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
currendb and link tables May-G Microsoft Access VBA Modules 1 5th Mar 2008 04:08 PM
Office 2003 graphics filters no longer work in Access 2003 =?Utf-8?B?bWVzc2VuZ2VydGo=?= Microsoft Access Forms 2 12th Nov 2006 11:22 PM
Re: Method 'CurrenDb' of object '_Application' failed error. help!! Dirk Goldgar Microsoft Access 0 9th Sep 2004 04:01 PM
Re: Method 'CurrenDb' of object '_Application' failed error. help!! '69 Camaro Microsoft Access 0 9th Sep 2004 03:55 PM
Vill access 2003 xp-look on forms work in Access 2002/2000? Jesper F Microsoft Access Form Coding 0 17th Jan 2004 03:39 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:46 AM.