[AccessD] Programmaticly fill control events

Marcel Vreuls info at oop.nl
Thu Feb 20 06:14:01 CST 2003


Dear group,

I have added some more color to my app. This means the control where the
cursor is at that time is being highlighted. It works like a charm. I have
found this solution in the archives of this list.

But I have more than 200 forms en I gues more that 2500 controls. Is there a
way through code to add an event to a control. So open the form en check all
controls (that's what I know) but I don not know how to add an event and add
some code through it. Anyone?

Thanks Marcel

-----Original Message-----
From: accessd-admin at databaseadvisors.com
[mailto:accessd-admin at databaseadvisors.com]On Behalf Of Gustav Brock
Sent: donderdag 20 februari 2003 12:32
To: info
Subject: Re: [AccessD] Rownumbers


Hi Marcel

You can add a subquery to return the rownumber (RowNo):

<SQL>

SELECT
  OR_OD_NUMMER,
  OR_NUMMER,
  (SELECT
    COUNT(*)
  FROM
    tblOrderDetail AS tblA
  WHERE
  tblA.OR_OD_NUMMER = tblOrderDetail.OR_OD_NUMMER
  AND
  tblA.OR_NUMMER <= tblOrderDetail.OR_NUMMER;) AS RowNo
FROM
  tblOrderDetail
ORDER BY
  OR_OD_NUMMER,
  OR_NUMMER;

</SQL>

/gustav

> I will try in my best englisch to make this problem clear to you. Hope it
> works:-) I have a table in my database with an autonumber field and a
field
> wich contains ordernumers. It looks like this

> OR_NUMMER    OR_OD_NUMMER
> 1000                    10
> 1001                    10
> 1002                    10
> 1003                    11
> 1004                    11
> 1005                    10
> 1007                    12
> 1008                    10

> Now we want to print on a report the actual orderposition of a current
> record. For example ordernumber 10 contains rownumbers 1000,
> 1001,1002,1005,1008. We would like to print 1, 2, 3, 4, 5 according to the
> actuel rownumbers. I have tried to make this happen to take parts of the
> actual autonumber but that is not sufficient enough.

> What I am trying is to make a function whicht take the current recordset
and
> put in a field with a number a calculatie in the function.

> FncRownumber(ByRef rs as dao.recordset)
>     Dim Rownumber as long

>     rs.movefirst
>     Do while not rs.eof
>         Rownumber = Rownumber + 1
>         rs.movenext
>     loop
> End function

> It works but I cannot get this in the report because then I lose the
> recordset.

> Are there other ways to make this happen exept putting an extra field in
the
> table which contains this recordnumber?


> Thanks, Marcel Vreuls

_______________________________________________
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