Open form to particular record

  • Thread starter Thread starter AC
  • Start date Start date
A

AC

I have a table containing several fields but the data is
entered at different times. How can I set up my form so
that On Open it prompts for the RecordName and opens to
that record in the form. I tried the button wizard but it
doesn't always search on the right field and it's the find
and replace button dialog box that pops up. Thanks for any
pointers you can provide.
 
Many time I will place a combo box in the Header of my
form and have this combo box display the values I want to
use for the lookup. The on the AfterUpdate event of the
combo box, I place code that will go to the desired
record. Take a look at GoToRecord in the help file.

HTH

Byron
 
This sounds very similar to using the Control Wizard to
add an unbound ComboBox to the header of the form, which
is then instructed to look up the record you want. The
problem I find with this, is that on opening the form,
the cursor goes to the body of the form (i.e. the default
record), so that one has to click onto the ComboBox
before entering the record to look up. Then after looking
up the record, the cursor stays in the lookup ComboBox. I
would like it to then go to the record looked up so as to
be able to edit it. Can anyone tell me what to do to
achieve these two objectives?

Carl
 
Carl,

Try setting your tab sequence. The wizard does not address
the tab order of the form. The cursor should go to the
first control specified by the tab order. If that does
not work for you, then you can add code to the OnCurrent
event of the form to force the cursor to the combo box of
your choosing using the code below:

Me.ControlName.Setfocus

By the way you can also have the drop down list to drop
down.

The next issue is solved in much the same way. Place the
same code in the AfterUpdate event of the combo box,
except this time reference the control you want the cursor
to move to.

HTH

Byron
 
Back
Top