PC Review


Reply
Thread Tools Rate Thread

control reference change bet. 2002 & 2003?

 
 
Fredrated
Guest
Posts: n/a
 
      6th Apr 2010
I am trying to run an Access 2002 program under Access 2003, but a control
reference doesn't seem to work:
In a report query I reference a control in a date criteria as:
>=[Forms]![fPaymentReport].[StartDate] And <[Forms]![fPaymentReport].[EndDate]+1

In Access 2002 it works with no problem.
In Access 2003 I get a prompt asking for Forms!fPaymentReport.StartDate

Is there a change from 2002 to 2003 in how to reference a control from
within a query? Or is there possibly some other problem caused by using my
2002 app in 2003?

Thanks in advance for any help.

Fred


 
Reply With Quote
 
 
 
 
ryguy7272
Guest
Posts: n/a
 
      6th Apr 2010
I don't have 2002; use 2007. I just tried it and it worked just fine for me.
Are you sure that's a one and not a lower-case L. Maybe delete the 1, and
add save, then open and add the 1 back in. Maybe you need to do a compact
and repair. Again, that concept worked fine for me...

Look at this for some ideas of how to do what you're trying to do:
http://mvps.org/access/forms/frm0031.htm


--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Fredrated" wrote:

> I am trying to run an Access 2002 program under Access 2003, but a control
> reference doesn't seem to work:
> In a report query I reference a control in a date criteria as:
> >=[Forms]![fPaymentReport].[StartDate] And <[Forms]![fPaymentReport].[EndDate]+1

> In Access 2002 it works with no problem.
> In Access 2003 I get a prompt asking for Forms!fPaymentReport.StartDate
>
> Is there a change from 2002 to 2003 in how to reference a control from
> within a query? Or is there possibly some other problem caused by using my
> 2002 app in 2003?
>
> Thanks in advance for any help.
>
> Fred
>
>

 
Reply With Quote
 
Fredrated
Guest
Posts: n/a
 
      6th Apr 2010
One thing I forgot to mention: the access 2002 app which runs successfully is
running in win xp, the 2003 version is running on a win 7 machine, and win 7
has caused other problems with access apps.

As for the response by ryguy7272, the 1 is indeed a one, but the suggestion
to compact/repair the database is a good one, I will do that as soon as I can
get to the machine (the interface is stored locally).

"Fredrated" wrote:

> I am trying to run an Access 2002 program under Access 2003, but a control
> reference doesn't seem to work:
> In a report query I reference a control in a date criteria as:
> >=[Forms]![fPaymentReport].[StartDate] And <[Forms]![fPaymentReport].[EndDate]+1

> In Access 2002 it works with no problem.
> In Access 2003 I get a prompt asking for Forms!fPaymentReport.StartDate
>
> Is there a change from 2002 to 2003 in how to reference a control from
> within a query? Or is there possibly some other problem caused by using my
> 2002 app in 2003?
>
> Thanks in advance for any help.
>
> Fred
>
>

 
Reply With Quote
 
Dirk Goldgar
Guest
Posts: n/a
 
      6th Apr 2010
"Fredrated" <(E-Mail Removed)> wrote in message
news:99A99DD6-E1C0-48CF-AAEA-(E-Mail Removed)...
>I am trying to run an Access 2002 program under Access 2003, but a control
> reference doesn't seem to work:
> In a report query I reference a control in a date criteria as:
>>=[Forms]![fPaymentReport].[StartDate] And
>><[Forms]![fPaymentReport].[EndDate]+1

> In Access 2002 it works with no problem.
> In Access 2003 I get a prompt asking for Forms!fPaymentReport.StartDate
>
> Is there a change from 2002 to 2003 in how to reference a control from
> within a query? Or is there possibly some other problem caused by using
> my
> 2002 app in 2003?
>
> Thanks in advance for any help.



Does it make any difference if you change the dot (.) to a bang (!):

=[Forms]![fPaymentReport]![StartDate] And
<[Forms]![fPaymentReport]![EndDate]+1

That is more technically correct, though my Access 2003 seems to accept the
dot.

--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)

 
Reply With Quote
 
Fredrated
Guest
Posts: n/a
 
      9th Apr 2010
My mistake, the problem is slightly different from what I described.
The report query doesn't actually reference a control on the form, but
rather a custom form property which serves up the needed information. I
prefer this method of 'implementation hiding' as my preferred 'oop' style of
programming. This is what broke in the query. To fix this until I can find
out how to refer to a form property in a query, I have edited my query to
refer to the control instead of the property, and the application works again.

The property reference I described in the post, for example,
>=[Forms]![fMain].[CurFrom] And <=[Forms]![fMain].[CurThru]

has worked until now, but now it seems Accss has changed how to refer to a
form property, so how to do so in Access 2003 is what I need to figure out.

Thanks for your reply and help!

Fred

> "Fredrated" <(E-Mail Removed)> wrote in message
> news:99A99DD6-E1C0-48CF-AAEA-(E-Mail Removed)...
> >I am trying to run an Access 2002 program under Access 2003, but a control
> > reference doesn't seem to work:
> > In a report query I reference a control in a date criteria as:
> >>=[Forms]![fPaymentReport].[StartDate] And
> >><[Forms]![fPaymentReport].[EndDate]+1

> > In Access 2002 it works with no problem.
> > In Access 2003 I get a prompt asking for Forms!fPaymentReport.StartDate
> >
> > Is there a change from 2002 to 2003 in how to reference a control from
> > within a query? Or is there possibly some other problem caused by using
> > my
> > 2002 app in 2003?
> >
> > Thanks in advance for any help.

>
>
> Does it make any difference if you change the dot (.) to a bang (!):
>
> =[Forms]![fPaymentReport]![StartDate] And
> <[Forms]![fPaymentReport]![EndDate]+1
>
> That is more technically correct, though my Access 2003 seems to accept the
> dot.
>
> --
> Dirk Goldgar, MS Access MVP
> Access tips: www.datagnostics.com/tips.html
>
> (please reply to the newsgroup)
>

 
Reply With Quote
 
Dirk Goldgar
Guest
Posts: n/a
 
      9th Apr 2010
"Fredrated" <(E-Mail Removed)> wrote in message
news:1664BCF4-8AE0-4573-8D9E-(E-Mail Removed)...
> My mistake, the problem is slightly different from what I described.


<sigh!> <g>

> The report query doesn't actually reference a control on the form, but
> rather a custom form property which serves up the needed information. I
> prefer this method of 'implementation hiding' as my preferred 'oop' style
> of
> programming. This is what broke in the query. To fix this until I can
> find
> out how to refer to a form property in a query, I have edited my query to
> refer to the control instead of the property, and the application works
> again.
>
> The property reference I described in the post, for example,
>>=[Forms]![fMain].[CurFrom] And <=[Forms]![fMain].[CurThru]

> has worked until now, but now it seems Accss has changed how to refer to a
> form property, so how to do so in Access 2003 is what I need to figure
> out.
>
> Thanks for your reply and help!


How did you implement your custom property? I just tried it with a property
implemented via this Public Property Get procedure:

Public Property Get curID() As Long

curID = Me.ID

End Property

I created a query with this SQL:

SELECT Table1.* FROM Table1
WHERE Table1.ID=[Forms]![Form2].[curID];

That query worked fine, and returned the record identified by the form's
curID property.

--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)

 
Reply With Quote
 
Fredrated
Guest
Posts: n/a
 
      9th Apr 2010
My code is exactly like yours, except that the word 'Public' was not in front
of the word 'property'. This has always worked in the past, but perhaps
Microsoft is being more strict.

So I put 'Public' in front of the properties. Oddly, it didn't work at
first, but after I closed the app and reopened it, voila! It works!

Thanks a lot for your help.

Fred

"Dirk Goldgar" wrote:

> "Fredrated" <(E-Mail Removed)> wrote in message
> news:1664BCF4-8AE0-4573-8D9E-(E-Mail Removed)...
> > My mistake, the problem is slightly different from what I described.

>
> <sigh!> <g>
>
> > The report query doesn't actually reference a control on the form, but
> > rather a custom form property which serves up the needed information. I
> > prefer this method of 'implementation hiding' as my preferred 'oop' style
> > of
> > programming. This is what broke in the query. To fix this until I can
> > find
> > out how to refer to a form property in a query, I have edited my query to
> > refer to the control instead of the property, and the application works
> > again.
> >
> > The property reference I described in the post, for example,
> >>=[Forms]![fMain].[CurFrom] And <=[Forms]![fMain].[CurThru]

> > has worked until now, but now it seems Accss has changed how to refer to a
> > form property, so how to do so in Access 2003 is what I need to figure
> > out.
> >
> > Thanks for your reply and help!

>
> How did you implement your custom property? I just tried it with a property
> implemented via this Public Property Get procedure:
>
> Public Property Get curID() As Long
>
> curID = Me.ID
>
> End Property
>
> I created a query with this SQL:
>
> SELECT Table1.* FROM Table1
> WHERE Table1.ID=[Forms]![Form2].[curID];
>
> That query worked fine, and returned the record identified by the form's
> curID property.
>
> --
> Dirk Goldgar, MS Access MVP
> Access tips: www.datagnostics.com/tips.html
>
> (please reply to the newsgroup)
>

 
Reply With Quote
 
Dirk Goldgar
Guest
Posts: n/a
 
      9th Apr 2010
"Fredrated" <(E-Mail Removed)> wrote in message
news:6C68A9F2-D56F-4464-925D-(E-Mail Removed)...
> My code is exactly like yours, except that the word 'Public' was not in
> front
> of the word 'property'. This has always worked in the past, but perhaps
> Microsoft is being more strict.


Hmm, I don't think they are, at least not intentionally. I explicitly
specified Public, but according to the VB help file, "If not explicitly
specified using Public, Private, or Friend, Property procedures are public
by default." And I just tested a version of the procedure without
specifying Public (just "Property Get curID()"), and it worked fine in my
query.

> So I put 'Public' in front of the properties. Oddly, it didn't work at
> first, but after I closed the app and reopened it, voila! It works!


I have a feeling there may be something odd going on with your database --
possibly some corruption of your VB project. Just in case, I recommend
making a backup copy, then decompiling and recompiling the database.

--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)

 
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
Shortcut to change change cell reference to Absolute reference? =?Utf-8?B?cmljaGs=?= Microsoft Excel Worksheet Functions 12 5th Dec 2009 12:24 AM
Change a format PST 97-2002 to 2003 henpat Microsoft Outlook Discussion 2 10th Mar 2005 08:19 AM
Word 2002 cross reference problem: Error! Reference source not found Sam Dutton Microsoft Word Document Management 0 31st Mar 2004 02:49 PM
Outlook Cr$Lf$ Change from 2002 to 2003 ? Al Franz Microsoft Outlook 0 16th Mar 2004 05:35 PM
Subform control reference - Migration from 97 to 2002 problem =?Utf-8?B?RGFuIEZhcmxleQ==?= Microsoft Access Form Coding 1 14th Nov 2003 03:09 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:50 AM.