adding records to tables using unbound controls

A

Amanda

I have an Animal Quick Entry form (continuous), that operates on the Animal
Records table- each animal has a record. The form is designed to add journal
records (in a separate,related Animal Journal table) for a batch of animals.

The continuous form part enables me to preview a batch of animals and create
a collection of their IDs so I can create the journal entry for each animal
ID.

Typically I would add a journal entry with DoCmd.OpenRecord ... acNewRec,
but I've only done this with bound controls, and the connection to the
appropriate fields is automatic. The form has a few unbound controls to set
the values of the journal fields to be appended, but how do I connect this
data to the fields when I create my new records?

Thanks, Amanda
 
A

Amanda

No, the continuous form is tied to the Animal Records table, and is filtered
based on animal criteria. The form allows me to preview the list of animals,
and I want to create a batch journal entry for those animals.

For example, the continuous form shows animal records that have been
filtered based on criteria like "species". If my Animal Keepers dewormed all
the tigers today, the continuous form will show a list of tigers so they can
verify which tigers will get records, then the unbound controls allow them to
select the data that will be entered into the journal for those animals
(entry type: "medical", note: "deworming").

When they click the button, it should create a new journal entry for each
animal ID in a collection. I've already created the code to generate the
collection, so I thought I would create a loop and create a new record for
each animal ID in the collection, but unsure how to tie in the unbound data.

- A
 
K

Klatuu

Well you gave me a lot of good information, but not where the controls are.
You could create an update query that will use the values from the unbound
controls and filter the query exactly like you filter the continuous form.
 

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