Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Embedding VB code within a table

Status
Not open for further replies.

Anubis3000

Programmer
Dec 20, 2004
52
US
Hi,

This question might seem a bit bizarre, but I'll ask it anyway.

I wanted to know if there is anyway to embed VB code within a table.

Specifically, I would want to put this (pseudo)code within the table:

On Table_Open
Field2.Setfocus
If Field2 = "A Value" Then
'do stuff here
End If
End Sub

I realize that this would be best done using forms, but I wanted to know if there is someway to execute commands at the table level. I don't think this is possible, but if anyone has any ideas, it would be appreciated. Thanks.


 
As far as I know, JetSQL has no provision for any kind of trigger.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 

Or write a function, and call the function from the query (wont work on a table, ony a query) The return of the function fives you what you need and the arguments pass whatever info it is based on.

Simplistic example

public function blIsOne(vrNumber as variant)as boolean
if vrNumber=1 then
blIsOne=true
else
blIsOne=false
exit function

and in the query add

Expr1: blisone([mynumberfield])

 
If the eval function could be used at a table level, how would I implent it? use eval() as a default value?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top