PDA

View Full Version : Solved: Access Forms Help



Rollin_Again
08-17-2004, 11:29 AM
I have an Access application that has two forms. The first form is called "frmVendors" and the second form is called "frmVendorContacts" The second form "frmVendorContacts" is used to display specific detailed contact information about the Vendor selected on the first form (they are linked by ID numbers)

After adding a new Vendor using the first form, I display the second form (frmVendorContacts) so that I can add a corresponding Contact record for the new Vendor. I have used the command
DoCmd.OpenForm "frmVendorContacts", , , , acFormAdd to open a blank VendorContact form that will be filled with various contact info. I would like to automatically populate one of the text fields on the second form (conID) with a variable value from the first form (venID.) This variable (venID) gets its value from an auto-ID field on the first form.

How do I do this? Sorry for my ignorance, I am only used to working with custom designed forms and using VB not these forms that are automatically created by Access using all these built in commands.

Rollin

VicRauch
08-18-2004, 10:52 PM
Rollin-
set the default value for conID to:
=Forms!frmVendors!venID
This will set the conID value to the venID value from the frmVendors form.

It really sounds like you are doing a form with a subform type of application. If so, you can put the frmVendorContacts within the frmVendors form, then using the properties for the "subform" of frmVendorContacts, data tab, set the venID in the "Link Master Fields" and "Link Child Fields." Then the forms will automatically take care of populating the correct data in your sub-form (frmVendorContacts).

Hope this helps,
Vic

Anne Troy
09-01-2004, 07:49 AM
Rollin: Was Vic able to help you here?
If so, I'll mark it solved. :)

Rollin_Again
09-02-2004, 09:13 PM
Thanks Vic. That is exactly what I needed to know.


Rollin