Comments form help

S

SJ

I have been asked to create a button on a main form that displays
client data and will allow my users to add comments about the
respective clients in the db. I think this should have been done as a
subform, but I inherited this and it is not an option. I've been
searching the groups and web and haven't come up with anything yet.
I'm hoping someone there can help.
I need a command button that when clicked, will open a form and allow
my users to make whatever comments they need. The problem I am coming
up with is synching the client_id on the main form to the client_id on
the
new form. The source for the new form is a query that writes to a
table called, "Comments." I need to be able to select a client id
then hit the button and enter and view comments for that client only.
I can't seem to make it work. Frankly, I've reached a point where I'm
just banging around blindly. Has anyone worked with something like
this, and if so, could you share with me your solution - or just steer
me in the right direction?


Any help is much appreciated.
Thanks!
SJ
 
M

Mark A. Sam

Hello SJ,

Open the comment form using this syntax


DoCmd.OpenForm "SomeForm", , , , acFormAdd, , client_id

The value of client_id will be passed to the new form as a property called
OpenArgs which can us used as a variable in the new form. Place a textbox
for client_id on the new form and set the Default value as [OpenArgs]. You
can make the client_id field invisible. This will make client_id the
ChildLinkField and it will be automatically populated whenever you add a new
records, as long as you open the form as shown above.

God Bless,

Mark A. Sam
 
S

SJ

Hello SJ,

Open the comment form using this syntax

DoCmd.OpenForm "SomeForm", , , , acFormAdd, , client_id

The value of client_id will be  passed to the new form as a property called
OpenArgs which can us used as a variable in the new form.  Place a textbox
for client_id on the new form and set the Default value as [OpenArgs].  You
can make the client_id field invisible.  This will make client_id the
ChildLinkField and it will be automatically populated whenever you add a new
records, as long as you open the form as shown above.

God Bless,

Mark A. Sam




I have been asked to create a button on a main form that displays
client data and will allow my users to add comments about the
respective clients in the db.  I think this should have been done as a
subform, but I inherited this and it is not an option.  I've been
searching the groups and web and haven't come up with anything yet.
I'm hoping someone there can help.
I need a command button that when clicked, will open a form and allow
my users to make whatever comments they need.  The problem I am coming
up with is synching the client_id on the main form to the client_id on
the
new form.  The source for the new form is a query that writes to a
table called, "Comments."  I need to be able to select a client id
then hit the button and enter and view comments for that client only.
I can't seem to make it work.  Frankly, I've reached a point where I'm
just banging around blindly.  Has anyone worked with something like
this, and if so, could you share with me your solution - or just steer
me in the right direction?
Any help is much appreciated.
Thanks!
SJ- Hide quoted text -

- Show quoted text -

Thank you for your help! Unfortunately, I must be doing something
wrong. I coded the command button to open the comments form using the
syntax that you provided, and I set the default value of the client_id
to [OpenArgs]. What I get when I click the button is a blank comment
form with the correct client_id. I can't view any of the other
comments and I wanted the customer's name to appear but it does not.
I am probably just overlooking something, but so far I can't figure it
out.
 
M

Mark A. Sam

SJ,

I may not be understanding your need. The method I provided will associate
comments to a particular main record. For example, if a client was named
Bubba's Grits and Beans and you added comments to the comment (popup) form,
they would pertain only to Bubba's record. If the popup form were
continuous you would view all of the comments for Bubba when you opened the
comment form. If you changed the main form to Millie's Mac and Cheese, then
the comments would pertain to Millie, and not Bubba. Does that make sense?

God Bless,

Mark



Thank you for your help! Unfortunately, I must be doing something
wrong. I coded the command button to open the comments form using the
syntax that you provided, and I set the default value of the client_id
to [OpenArgs]. What I get when I click the button is a blank comment
form with the correct client_id. I can't view any of the other
comments and I wanted the customer's name to appear but it does not.
I am probably just overlooking something, but so far I can't figure it
out.
 

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