[AccessD] Syntax question about control references

Mackin, Christopher CMackin at Quiznos.com
Tue Sep 7 10:17:14 CDT 2004


strCtlName = CStr(eom(date))
Me(strCtlName).SetFocus 

Should work.

-Chris Mackin

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Arthur Fuller
Sent: Tuesday, September 07, 2004 8:38 AM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] Syntax question about control references


My form has controls whose names derive from the EoM() of a given date.
That is, the end of a month. The control's name will be something such
as "12/31/2004", etc. I need to set the focus to the column
corresponding to today's date. For the date on which I am writing this
message, the correct column is named "9/30/2004". I can derive this like
so:

? eom(date)
9/30/2004 

The EoM() function (which I wrote) returns a date. I need to take this
value and turn it into a reference to a column, such that I can write:

Me.columnName.SetFocus

I haven't quite got it yet. Any suggestions?

TIA,
Arthur



-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart
McLachlan
Sent: Tuesday, September 07, 2004 2:39 AM
To: Access Developers discussion and problemsolving
Subject: Re: [AccessD] A2K: Another Recordset Syntax Q


On 7 Sep 2004 at 16:26, Darren DICK wrote:

>   For x = 1 To rs.RecordCount
>   	With rs
> 	      .MoveLast
>       	 MsgBox !SiteName
>             .MoveNext
>       End With
>   Next
> 

You keep moving to the last record before you display the Sitename

Try

rs.Movefirst
While not rs.eof
     Msgbox rs!Sitename
    rs.Movenext
Wend
-- 
Stuart


-- 
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list