Using Dmax at an external table

A

Art Vandaley

Can somebody please give me an idea about following?

Y = DMax("[field1]", "table1")

What can it be the syntax if "table1" is in an external database? Regards.

PS. I cannot use linking because table1 must be only in the database in
server.
 
J

John Vinson

Can somebody please give me an idea about following?

Y = DMax("[field1]", "table1")

What can it be the syntax if "table1" is in an external database? Regards.

PS. I cannot use linking because table1 must be only in the database in
server.

Um? You can link to a database on a server, provided the server and
the frontend are on the same stable LAN. In fact it's perfectly
routine to use a split database, with the backend containing the
tables on a server and the frontend on each user's workstation.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
A

Art Vandaley

Hi John,

I think i did something with a query. Just, I need to ask max value of the
field as an criteria. But Dmax is not accepted as an criteria. Is there a
way to tell the query to bring only the max. value of the field? Regards.



haber iletisinde sunlari said:
Can somebody please give me an idea about following?

Y = DMax("[field1]", "table1")

What can it be the syntax if "table1" is in an external database? Regards.

PS. I cannot use linking because table1 must be only in the database in
server.

Um? You can link to a database on a server, provided the server and
the frontend are on the same stable LAN. In fact it's perfectly
routine to use a split database, with the backend containing the
tables on a server and the frontend on each user's workstation.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
J

John Vinson

Hi John,

I think i did something with a query. Just, I need to ask max value of the
field as an criteria. But Dmax is not accepted as an criteria. Is there a
way to tell the query to bring only the max. value of the field? Regards.

Dmax() is fine as a criterion; I use it often. A subquery using the
Max operator works too, and may well be faster, but the resulting
query is not updateable. Could you post the SQL view of your query?


John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
A

Art Vandaley

Hi John,

SELECT Max([table1].[field1]) AS [MaxOffield1]
FROM [table1] IN 'C:\trial.mdb';

Can you please translate above things to VBA for me? Best Regards.
 
J

John Vinson

Hi John,

SELECT Max([table1].[field1]) AS [MaxOffield1]
FROM [table1] IN 'C:\trial.mdb';

Can you please translate above things to VBA for me? Best Regards.

Sorry to be so late getting back!

DLookUp won't work, I don't think. Try:

Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim strSQL As String
strSQL = "SELECT Max([table1].[field1]) AS [MaxOffield1]" _
& "FROM [table1] IN 'C:\trial.mdb';"
Set db = CurrentDb
Set rs = db.OpenRecordset(strSQL)
vMaxField1 = rs!MaxOfField1
rs.Close
Set rs = Nothing


John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 

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