Refer to a record in query or table source object?

R

RB

When one moves between records or clicks on a record in a subform with a
query to table source object, the <On Enter> event is fired. Can I use this
event to refer to a value in a field of the current record? If so, what is
the method?

Thanks in advance,

RB
 
S

Steve Schapel

RB

I would suggest using the Current event rather than the Enter event.
Refer to the field value like this...
Me!NameOfField
 
R

RB

Thanks but, no such luck. There isn't a current event when the source
object is a table or query and not a form. There also isn't a control such
as Me!NameOfField.

Any other thoughts?

RB
 
S

Steve Schapel

RB,

On re-reading your original post, I now understand your meaning. Sorry,
I am out of my depth here... I have never used a "subform with a query
to table source object", nor can I imagine I will ever need to do so.
However, I have just made one, just for fun, and I find that there is a
Current event, and that you can in fact use the syntax I suggested to
refer to a field in the table. It would be easier, though, to make a
form to use as the subform... any reason for not?
 
R

RB

Steve:

What version of Access are you using? I'm using 2000 so, that's probably
where our difference is. We have to use the query instead of a form because
we're importing data from variable external sources that don't have the
field names that we would like them to have. It's a dynamic, on-the-fly way
to view what we need.

Thanks,

RB
 
S

Steve Schapel

RB,

I am also using Access 2000. But in fact the version of Access should
not be relevant here.

Do you mean that the fields in the query that the subform is based on
will have names that vary from time to time? Your original question
related to the value of a field, so how are you supposed to refer to a
field if you don't know what its name is?

Maybe it would be good if you can give some examples
 

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