Copy Data from one Subform to another Subform

N

Nigel King

Hi, I'm designing a small hotel database to manage Bookings (tblbookings).

Sometimes a person enquiring (tblEnquirer) makes bookings for multiple
guests (tblGuests), requiring different names/addresses for Enquirer and
Guest. But most of the time the Enquirer and Guest is the same person, with
the same details.

The main form (frmbookings) has two subforms (subfrmEnquirer) and
(subfrmGuests). I am trying to create a macro that copies the contents of
the seven name/address fields from one subform across to the other.

How can I do this using just one or two actions?

Many thanks
 
N

Nigel King

I can get the data to copy across using a cut macro and a paste macro, but
it has to be done for every single field, which is laborious. A macro that
could run all the macros in sequence would be good, but I cant shift the
focus between subforms.

I have also created a MakeTable query, which holds all the data I need, but
I don't know how to get it into the required subform.

Thanks
 
V

Van T. Dinh

It seems to me that tblEnquirer & tblGuests should be combined into ONE
Table tblPerson then you can simply copy the PersonID (by code) between the
2 Subforms. This follows more in line with Relational Databse Design and
avoid duplication as much as possible.
 

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