Open a subform with a command button

T

Tara

Can I open a subform from a command button rather than have it embedded in
the main form? If so, how?

Thanks for any help!
 
N

Nick 'The database Guy'

Hi Tara,

Not sure what you mean here, it is not a subform unless it is embedded
in the main form.

Good luck,

Nick
 
T

Tara

Here's the basic situation: My *main* form lists Contact Information for
clients. I currently have a command button that opens a linked form
(filtered with the ID number of the record the user stops at from the first
form) and shows any open cases for that client. I then need to be able to
add a new record for that client from the second form. Set up this way
though, I get the error message "You can't add a record because a record is
required in TblClientContactInfo". I know I can use traditional subforms to
avoid that problem, but it's going to make my main form awfully crowded,
plus, I just don't like the *look* of subforms. I guess I'm hoping there's
another way to accomplish what I want, which is two independent forms which
are related through an ID number with the ability to add records to the
second form.


Thanks for any help!
 
R

Rick Brandt

Tara said:
Here's the basic situation: My *main* form lists Contact Information
for clients. I currently have a command button that opens a linked
form (filtered with the ID number of the record the user stops at
from the first form) and shows any open cases for that client. I
then need to be able to add a new record for that client from the
second form. Set up this way though, I get the error message "You
can't add a record because a record is required in
TblClientContactInfo". I know I can use traditional subforms to
avoid that problem, but it's going to make my main form awfully
crowded, plus, I just don't like the *look* of subforms. I guess I'm
hoping there's another way to accomplish what I want, which is two
independent forms which are related through an ID number with the
ability to add records to the second form.

Set the DefaultValue property of the controls on the second form that "would" be
linked to the other form (if it were an actual subform) so that they reference
the field values on the first form.

=Forms!FirstFormName!FieldName
 
T

Tara

Thanks Rick. Can I do this and still set conditions on the data? For
example, what the form currently does is show only open cases for the client.
The record source includes a WHERE statement that excludes any cases for the
client that have a close date. I still need it to do that, but I also need
to be able to add new records. Should I just add a different form for adding
new records in order to simplify things?
 
Top