PC Review


Reply
Thread Tools Rate Thread

Creating new records in a popup subform

 
 
=?Utf-8?B?YWxla2ZlbHN0aW5lcg==?=
Guest
Posts: n/a
 
      9th Nov 2007
Setup:

Main form (Contacts Form), based on a query of a "Contacts" table, that
returns all contacts. The main form has a search bar at the top. When
contacts are selected, their ContactID shows up as well as the rest of their
information.

A second form (Contact History), based on a query of the "Contact History"
table, which is linked to the "Contacts" table via ContactID. The Contact
History form's underlying query sets the criteria for ContactID to look up
the ContactID control in the Contacts Form. So, I select Contact A on the
Contacts Form, Contact A's ContactID comes up along with the other contact
information, and I can then open the Contact History form and view whatever
records in the "Contact History" table match Contact A's ContactID.

I also want users to be able to create NEW records in the Contact History
table via this Contact History Form, for whatever contact they're reviewing.
If they're looking at two Contact History records for Contact A, I want them
to be able to add a third, with the same ContactID.

When the Contacts Form and the Contact History form are completely separate,
this doesn't work. You can use the navigation buttons to click to a new
record, or use a command button with the Add Record script provided by
Access, but the ContactID which was retrieved from the Contacts Form is not
preserved -- it just empties that control in the form.

When the Contact History form is placed as a subform in the main Contacts
Form, with the ContactID fields linked, the Contact ID does stick around (I
guess because of the linked fields).

I'm happy for the Contacts History form to be a subform, but I really want
it to be a popup -- instead of cluttering up the main Contacts Form
interface. Can someone tell me how to do that?

Or, alternately, I can easily keep the Contact History form separate and
open it as a popup using a command button on the Contacts Form, but I need a
way to preserve the "retrieved" ContactID when creating new records.

Any help would be super-appreciated.

 
Reply With Quote
 
 
 
 
Rick Brandt
Guest
Posts: n/a
 
      9th Nov 2007
alekfelstiner wrote:
> Setup:
>
> Main form (Contacts Form), based on a query of a "Contacts" table,
> that returns all contacts. [snip]


> A second form (Contact History), based on a query of the "Contact
> History" table, which is linked to the "Contacts" table via
> ContactID. [snip]


> I also want users to be able to create NEW records in the Contact
> History table via this Contact History Form, for whatever contact
> they're reviewing. [snip]


> I'm happy for the Contacts History form to be a subform, but I really
> want it to be a popup -- instead of cluttering up the main Contacts
> Form interface. Can someone tell me how to do that?



Set the defaultValue property of the ContactID control on the popup form to...

=Forms![Contacts Form]!ContactID

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


 
Reply With Quote
Reply

« Pesquisas | fd »
Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating new records in a popup subform =?Utf-8?B?YWxla2ZlbHN0aW5lcg==?= Microsoft Access Forms 1 9th Nov 2007 08:55 PM
Creating new records in a popup subform =?Utf-8?B?YWxla2ZlbHN0aW5lcg==?= Microsoft Access Getting Started 1 9th Nov 2007 05:21 AM
Creating new records in a popup subform =?Utf-8?B?YWxla2ZlbHN0aW5lcg==?= Microsoft Access Form Coding 1 9th Nov 2007 03:03 AM
Creating new records in a popup subform =?Utf-8?B?YWxla2ZlbHN0aW5lcg==?= Microsoft Access Forms 0 9th Nov 2007 02:47 AM
Inserting records into junction table (and subform) from popup form kheisler6@cox.net Microsoft Access Form Coding 1 6th Jan 2007 10:24 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:26 AM.