Find a record combo box doesn't pull up data?

G

Guest

Fairly new to this and have a form that default opens to 'new record'.
However, want to be able to edit a record already in the data. Followed
previous posts suggestions -
http://www.access.qbuilt.com/html/find_a_record.html but am in Access 2000
and newcomer to code.
The combo box is in form header and showing correct data ('customer') but
when i select a customer, the rest of the form doesn't fill with the info for
that customer for me to edit as i anticipated it would. Not sure what else
to try?
Cheers
Kate
 
A

Allen Browne

If your form opens to a new record, it may have its Data Entry property set
to Yes. Set this to No if you want it to load existing records.

Alternatively, add this line to the top of the code in the combo's
AfterUpdate event:
If Me.FilterOn Then Me.FilterOn = False
That should cause Access to load all the existing records, so the one you
want can be found.
 
G

Guest

Thanks - I think this is working now! Just to be sure - The form still opens
on a new record but you can edit an old one as well as entering new data.
Looks like it's working like this but want to make sure that changing the
data entry property to 'no' won't affect this?

Cheers
Kate
 
A

Allen Browne

If you change Data Entry to No, the form will no longer open to a new
record.

If you added the line of code to the combo's event procedure and you have
the result you want, leave the form property as is.
 

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