Moving data from one form to another

M

Meryl

Hi,

I have 2 tables - a prospective donor table of people I
mail out solicitations and a donor-registration table
that has the people who have made actual donations. When
someone makes a donation, I want to move the data from
one table (via a form) to the other. I read someone
else's post about this, but I'm getting a compile error.
I don't know VBA, so I'm muddling in the dark. Can you
look at this and see what I am doing wrong? Do I need a
DoCmd statment for every field that I am moving? Here is
my code so far


stDocName = "2003 Individual Donations"
DoCmd.OpenForm "Donor-Registration Form-US", acNormal
DoCmd.GoToRecord , , acNewRec
Forms!Donor-Registration Form-US.FirstName(s).Value =
Forms!Prospective-Donor-Reg-Test.First Name(s).Value



Thx.
 
J

John Vinson

Hi,

I have 2 tables - a prospective donor table of people I
mail out solicitations and a donor-registration table
that has the people who have made actual donations. When
someone makes a donation, I want to move the data from
one table (via a form) to the other. I read someone
else's post about this, but I'm getting a compile error.
I don't know VBA, so I'm muddling in the dark. Can you
look at this and see what I am doing wrong? Do I need a
DoCmd statment for every field that I am moving? Here is
my code so far


stDocName = "2003 Individual Donations"
DoCmd.OpenForm "Donor-Registration Form-US", acNormal
DoCmd.GoToRecord , , acNewRec
Forms!Donor-Registration Form-US.FirstName(s).Value =
Forms!Prospective-Donor-Reg-Test.First Name(s).Value



Thx.

Since your form and control names have blanks and special characters
(hyphens and parentheses) you must enclose them in square brackets.

I'd suggest a different approach: rather than moving data from form to
form, you can move it from table to table using an Append query,
called from your form and using the Primary Key of the table as a
criterion (pulled from the form).

Even better might be to use just a single People table with a field
indicating whether this person is a solicitation recipient or a donor,
or just have a donations table related to the people table - storing
the same information in two different tables may not be the best
design!
 

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