Field referencing - Continous Form

S

Stu

How do you reference a specific field for update on a continous form?
Suppose I have three fields: ID, F1, F2 and the continuous form may have 20
records. If a user double clicks on F1, I want to place an "X" in field F2
for a subset of the 20 records based on the values in F1. Could someone
provide a code snippet to put an "X" in F2 if F1 has a certain value like
"ABC"?
 
T

Tom van Stiphout

On Thu, 27 May 2010 14:18:22 -0700, Stu

You could run an Update query. Create this query something like:
update myTable
set F2="X"
where F1="ABC"

Then in F1's DoubleClick event, write:
Currentdb.Querydefs("myQuery").Execute dbFailOnError
(of course you replace myObjectNames with yours)

To show the changes to the underlying table, you may have to requery
the form:
Me.Requery

-Tom.
Microsoft Access MVP
 

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