Simple Report

  • Thread starter Thread starter BobB
  • Start date Start date
B

BobB

I need to display the data in variable numbers of records per date
horizontally instead of vertically.

Example:

Driver No. 1 Name Hester Jones

Work Date Orders

Mar 3, 2003 324963 324968 324993 325704 324963 324968
324993 325704324963 324968 324993 325704324963
324968 324993 325704324963 324968
324993 325704324963 324968 324993 325704324963 324968
324993 325704324963 324968 324993
325704

Mar 4, 2003 325704 324963 324968 324993 325704 324963
324968 324993 325704324963 324968 324993
325704324963 324968 324993
325704324963 324968 324993 325704324963 324968 324993


etc.

Each 6 digit number is an entry in each record of the TagID Field. Currently
my report just lists them in the detail section in a vertical list.

I'd like to display them as shown above or multiple columns so that as
little as possible vertical space is used.

Any help is appreciated.

Thanks

BobB

(e-mail address removed)
(e-mail address removed)
 
It is quite easy to do this. You get need to write a small function that
takes the driver ID, and then returns a "list" of the related orders.

You just make a public function, and then place a text box on the form with
the name of the function

=ShowDriverOrders([id])


Public Function ShowDriverOrders(vID As Variant) As String

Dim rst As DAO.Recordset
Dim strSql As String

If IsNull(vID) Then Exit Function

strSql = "select OrderNum from tblOrders where Driver_id = " & vID
Set rst = CurrentDb.OpenRecordset(strSql)

Do While rst.EOF = False
If ShowDriverOrders <> "" Then ShowDriverOrders = ShowDriverOrders &
","
ShowDriverOrders = ShowDriverOrders & rst!OrderNum
rst.MoveNext
Loop

rst.Close
Set rst = Nothing


End Function

You will of course replace "ID" and OrderNum with whatever you used. If you
are looking for general code solution that does the same as above, but is
more general,
check out:

http://www.mvps.org/access/modules/mdl0004.htm

Use which ever one you find simpler for you needs.
--
Albert D. Kallal (MVP)
Edmonton, Alberta Canada
(e-mail address removed)
http://www.attcanada.net/~kallal.msn



Public Function
 
Back
Top