Linking data between forms

P

Paul

I have created two forms, one for CONTACTS the other for
REQUESTS. I want the create a button on the CONTACTS form
that will open the REQUESTS form and populate the
ContactID field from the CONTACTS form to the ContactID
field on the REQUEST form.

I have tried the relationships, no luck, must be missing
something. I tried creating a sub-form, that worked, but I
don't like the layout. I want a separate form to pop up
when I click the ADD REQUEST button.

Thanks in advance.

pbyford(NOSPAM)@telus.net
 
D

Dirk Goldgar

Paul said:
I have created two forms, one for CONTACTS the other for
REQUESTS. I want the create a button on the CONTACTS form
that will open the REQUESTS form and populate the
ContactID field from the CONTACTS form to the ContactID
field on the REQUEST form.

I have tried the relationships, no luck, must be missing
something. I tried creating a sub-form, that worked, but I
don't like the layout. I want a separate form to pop up
when I click the ADD REQUEST button.

Thanks in advance.

pbyford(NOSPAM)@telus.net

The idea being to create a new request for the current contact? Try
something like this:

DoCmd.OpenForm "REQUESTS", DataMode:=acFormAdd
Forms!REQUESTS.ContactID = Me.ContactID
 
P

Paul

Thanks. It works great now.

BTW, can you recommend a website that will help with
finding out how to write these functions??

Cheers
 
D

Dirk Goldgar

Paul said:
Thanks. It works great now.

BTW, can you recommend a website that will help with
finding out how to write these functions??

I don't know a web site that actually has a tutorial for VBA itself.
For that you probably want a book. Several good ones have been
suggested in messages on the Access newsgroups, so if you search Google
Groups (http://groups.google.com) in the *.*access.* groups for "VBA
book recommendations", I expect you'll find lots of recommendations.

For a great collection of task-oriented tips and sample code, I
recommend The Access Web:

http://www.mvps.org/access/

That site also has lots of links to other good sites.
 

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