Table vs Query - question

G

Guest

Dear Gurus

I hope you could help me with this question. I have searched to long now on
the web now…

I have a report based on a table with some duplicates. I want to preview the
report and have the following code.

Dim stWare As String
stWare = "[BuySell] = 'Buy' And [Printed] = 0 "
DoCmd.OpenReport "Stockreport", acViewPreview, , stWare
'DoCmd.RunSQL "UPDATE tblOrder SET tblOrder.Printed=-1 WHERE Printed=0;"

The [No] field is were the duplicates are and I don’t want any duplicates,
just the unique ones.

I want a third filter, when a duplicate is found in the table, the filter
should find the next increased value, to move to the next record when [No] is
4 to 5 or the next [No] that’s more then 4.

Is there a “findfirst†when the table is not based on a query?
Or “WhereCondition†is increasing?

Please, I don’t want to make a query if it’s possible. I still want to use
my table.

Any help would be appreciated

TIA
 
M

Michel Walsh

Hi,


I am quite far to understand your problem, but IF you have, say, a
ClientID field and a NumberID field, then, you want to get just ClientID
just ONCE, with its minimum NumberID field, THEN you can do

SELECT ClientID, MIN(NumerID) As MinNumber
FROM myTable
GROUP BY ClientID



Hoping it may help,
Vanderghast, Access MVP
 
G

Guest

This is problably the thing I was looking for...

I will dive right in to it..

Thank's a lot Michel...

Michel Walsh said:
Hi,


I am quite far to understand your problem, but IF you have, say, a
ClientID field and a NumberID field, then, you want to get just ClientID
just ONCE, with its minimum NumberID field, THEN you can do

SELECT ClientID, MIN(NumerID) As MinNumber
FROM myTable
GROUP BY ClientID



Hoping it may help,
Vanderghast, Access MVP


Stefan said:
Dear Gurus

I hope you could help me with this question. I have searched to long now
on
the web now.

I have a report based on a table with some duplicates. I want to preview
the
report and have the following code.

Dim stWare As String
stWare = "[BuySell] = 'Buy' And [Printed] = 0 "
DoCmd.OpenReport "Stockreport", acViewPreview, , stWare
'DoCmd.RunSQL "UPDATE tblOrder SET tblOrder.Printed=-1 WHERE
Printed=0;"

The [No] field is were the duplicates are and I don't want any duplicates,
just the unique ones.

I want a third filter, when a duplicate is found in the table, the filter
should find the next increased value, to move to the next record when [No]
is
4 to 5 or the next [No] that's more then 4.

Is there a "findfirst" when the table is not based on a query?
Or "WhereCondition" is increasing?

Please, I don't want to make a query if it's possible. I still want to use
my table.

Any help would be appreciated

TIA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top