carrying over ID to seperate form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This is probably easy, but it's stumping me right now. I have my main form
with genreal data on an individual and I have a button that launches a
seperate form where you can add comments. The comments table has the ID
field, Comments, and date. The ID on the general table has the one to many
relationship to the ID on the comments table.

All's i'm trying to do is have the ID show up in the comments form, so it
saves the ID number in the comments table.

I know there may be more to explain, but I'm not sure what.
Any ideas?
 
This is probably easy, but it's stumping me right now. I have my main form
with genreal data on an individual and I have a button that launches a
seperate form where you can add comments. The comments table has the ID
field, Comments, and date. The ID on the general table has the one to many
relationship to the ID on the comments table.

All's i'm trying to do is have the ID show up in the comments form, so it
saves the ID number in the comments table.

I know there may be more to explain, but I'm not sure what.
Any ideas?

The simplest way to do this is to use a Subform, perhaps on a tab page
if you need the screen space. Have you conciously and intentionally
rejected this option? If so, you can pass the ID in the OpenArgs
argument of the OpenForm method, and use it in the second form's Open
event to set the DefaultValue property. A lot more complicated than a
simple Subform!

John W. Vinson[MVP]
 
I already had the button made, and the macro set to open by filtering.
Setting the Comments ID default value to the main forms ID pretty much works.
I was more curious than anything else. I will probably do the tab control
since it seems a little more "stable".
I just wasn't really sure what my options were.
Thanks for the advice!
Now I know :)

-Jeff
 
Back
Top