Group:  Microsoft Access » microsoft.public.access.formscoding
Thread: performance between recordset and dlookup

Geek News

performance between recordset and dlookup
iccsi <inungh[ at ]gmail.com> 12/2/2008 5:38:32 PM
I have a report to support 2 languages.

I have 2 languages in the table and retreive depends on user prefer
language select.

The report has more than one hundred labels to print.

I would like to know to use Dlookup to assign label caption or using
recordset to get data in one shot and assign the label using tag
property.


I know that I can do some testing to compare.

If any one did test.can you please advise?

Your help is great appreciated,
Re: performance between recordset and dlookup
Marshall Barton <marshbarton[ at ]wowway.com> 12/2/2008 5:53:57 PM
iccsi wrote:

[Quoted Text]
>I have a report to support 2 languages.
>
>I have 2 languages in the table and retreive depends on user prefer
>language select.
>
>The report has more than one hundred labels to print.
>
>I would like to know to use Dlookup to assign label caption or using
>recordset to get data in one shot and assign the label using tag
>property.


A DLookup is essentially a query that returns one field
value. If you have to get more than a couple of values, you
are better off opening a recordset and using it to get all
the values by running a single query. If there a a ton of
records and you have to search for each value, you may(?)
need to make it a table type recordset and use Seek to
search for the needed values.

I don't see where the Tag property comes into it.

--
Marsh
MVP [MS Access]
Re: performance between recordset and dlookup
iccsi <inungh[ at ]gmail.com> 12/2/2008 7:44:49 PM
On Dec 2, 12:53 pm, Marshall Barton <marshbar...[ at ]wowway.com> wrote:
[Quoted Text]
> iccsi wrote:
> >I have a report to support 2 languages.
>
> >I have 2 languages in the table and retreive depends on user prefer
> >language select.
>
> >The report has more than one hundred labels to print.
>
> >I would like to know to use Dlookup to assign label caption or using
> >recordset to get data in one shot and assign the label using tag
> >property.
>
> A DLookup is essentially a query that returns one field
> value.  If you have to get more than a couple of values, you
> are better off opening a recordset and using it to get all
> the values by running a single query.  If there a a ton of
> records and you have to search for each value, you may(?)
> need to make it a table type recordset and use Seek to
> search for the needed values.
>
> I don't see where the Tag property comes into it.
>
> --
> Marsh
> MVP [MS Access]

Thanks for the message,
I named label like lblResult which needs a numeric to match ID in the
database. I assign a Tag number to match ID number in the recordset or
table.

Thanks again,

Re: performance between recordset and dlookup
Marshall Barton <marshbarton[ at ]wowway.com> 12/2/2008 8:27:36 PM
iccsi wrote:

[Quoted Text]
>On Dec 2, 12:53 pm, Marshall Barton <marshbar...[ at ]wowway.com> wrote:
>> iccsi wrote:
>> >I have a report to support 2 languages.
>>
>> >I have 2 languages in the table and retreive depends on user prefer
>> >language select.
>>
>> >The report has more than one hundred labels to print.
>>
>> >I would like to know to use Dlookup to assign label caption or using
>> >recordset to get data in one shot and assign the label using tag
>> >property.
>>
>> A DLookup is essentially a query that returns one field
>> value.  If you have to get more than a couple of values, you
>> are better off opening a recordset and using it to get all
>> the values by running a single query.  If there a a ton of
>> records and you have to search for each value, you may(?)
>> need to make it a table type recordset and use Seek to
>> search for the needed values.
>>
>> I don't see where the Tag property comes into it.
>>
>
>I named label like lblResult which needs a numeric to match ID in the
>database. I assign a Tag number to match ID number in the recordset or
>table.


Ahhh, that makes sense. Instead of the tag I sometimes have
put the ID number as part of the name (easier to see?).
E.g. lblX123, then the ID can be obtained by using the Mid
function as in code like:

For Each ctl In Me.Controls
If ctl.Name Like "lblX*" Then
ID = Mid(ctl.Name, 5)
rs.Seek ID
If rs.NoMatch Then
ctl.Caption = "Not in table"
Else
ctl.Caption = rs!French
End If
` End If
Next ctl

It doesn't really make that much difference unless the Tag
property is also needed for another purpose.

--
Marsh
MVP [MS Access]
Re: performance between recordset and dlookup
"Mike Painter" <mddotpainter[ at ]sbcglobal.net> 12/2/2008 10:57:58 PM
A recordset will always be faster but printing is slow even with fast
lasers.
Try the easier one first.
With only two languages, it might be just as easy to create two reports.
iccsi wrote:
[Quoted Text]
> I have a report to support 2 languages.
>
> I have 2 languages in the table and retreive depends on user prefer
> language select.
>
> The report has more than one hundred labels to print.
>
> I would like to know to use Dlookup to assign label caption or using
> recordset to get data in one shot and assign the label using tag
> property.
>
>
> I know that I can do some testing to compare.
>
> If any one did test.can you please advise?
>
> Your help is great appreciated,


Re: performance between recordset and dlookup
iccsi <inungh[ at ]gmail.com> 12/3/2008 2:21:52 AM
On Dec 2, 5:57 pm, "Mike Painter" <mddotpain...[ at ]sbcglobal.net> wrote:
[Quoted Text]
> A recordset will always be faster but printing is slow even with fast
> lasers.
> Try the easier one first.
> With only two languages, it might be just as easy to create two reports.
>
>
>
> iccsi wrote:
> > I have a report to support 2 languages.
>
> > I have 2 languages in the table and retreive depends on user prefer
> > language select.
>
> > The report has more than one hundred labels to print.
>
> > I would like to know to use Dlookup to assign label caption or using
> > recordset to get data in one shot and assign the label using tag
> > property.
>
> > I know that I can do some testing to compare.
>
> > If any one did test.can you please advise?
>
> > Your help is great appreciated,- Hide quoted text -
>
> - Show quoted text -

Thanks for helping,
The advantage of table is easier to maintain database.
If I need change any text then I can just update data without contact
user to update front end application.

Thanks again,

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net