How specify "currrent field" for DoCmd.FindRecord ?

S

Sverk

Hi,
On a table (in Access 2007) I am trying to use :
DoCmd.FindRecord [TestfieldValue], , , , , acAll, True
It works, in the sense that it finds a record that contains the
TestfieldValue --
but in the wrong field!
When I then try
DoCmd.FindRecord [TestfieldValue], , , , , acCurrent, True
it finds nothing, supposedly because it searches in the wrong field.
F1 Help says acCurrent makes for searching the "current field",
sound good, bu what is the current field? I can find no help on that.
So, how do I specify the current field here?
Please help!
Sverk
 
A

Allen Browne

Sverk, if you are opening a table in datasheet view and then trying to
control how the interface works, IMHO you need to design a form. The form
can be in datasheet view if you want it to look like a table.

Once you have a form, you can find out what the active control is. In code,
it is:
Me.ActiveControl
Add .Name if you want to refer to the name of the field, or .ControlSource
if you want to refer to what it is bound to. You will need error handling
(e.g. a command button doesn't have a ControlSource.) Screen.PreviousControl
can also be useful if you are using a command button.
 

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

Similar Threads


Top