Assign SQL expression to text field in Access ? 
Author Message
 Assign SQL expression to text field in Access ?

I have text field on access form and I want it to have ..

"Select max(price) from products"

..value

where should I write this SQL code ?
or how to write this sql in VB ?

thanks in advance

have a nice day



Tue, 12 Jul 2005 06:18:00 GMT  
 Assign SQL expression to text field in Access ?
Execute your SQL to create a recordset and then refer to the max price
column via the recordset using rs(1).   Columns can be refered by name
or column number and I think the numbers start at 1 as opposed to
zero.

Therefore to assign the max price to your field, your VB code can be

txtField = rs(1)

Hope this helps

Duncan

Quote:

> I have text field on access form and I want it to have ..

> "Select max(price) from products"

> ..value

> where should I write this SQL code ?
> or how to write this sql in VB ?

> thanks in advance

> have a nice day



Sat, 16 Jul 2005 07:54:03 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Error 20639: SQL Expression error - Error in creating SQL Expression COM Parser (cpeaut32)

2. Help on accessing TEXT fields in SQL Server

3. Accessing MS SQL Server Text Fields via RDO

4. Accessing MS SQL Server Text Field via RDO

5. SQL Expression in Field Explorer is MISSING

6. Using parameters in SQL Expression Fields

7. CR 8.8 SQL Expression Field

8. SQL Expression Field does not display

9. SQL Expression Field - SELECT error

10. SQL Expression field

11. Cannot Insert SQL Expression Field

12. SQL Expression Fields

 

 
Powered by phpBB® Forum Software