Pop up Problems

D

Doug_C

Hello,

I have created a main form with a pop up form to enter data in a table for a
comments field. however, when opening the pop up form all the comments
associate with that record is listed. How can I make the pop up form come up
blank, type in my comments, hit the save button(located on the pop up form)
and have the comment appear in the comments field on the main form? This is
the last step for completion. If need be, I can email the database for an
actual visual. Any assistance would be most appreciated and thank you to all
for getting me this far.

Thanks!!
 
J

Jeff Boyce

Doug

One approach would be to add code to the <save> button on the popup that
actually writes the contents to the main form. I am curious, though, why
your main form's comment control isn't simply bound to the underlying
table's comment field. This would save having to pop up an additional form.

Put another way, why not let the user enter the comment directly in the
comment control on the main form?

Regards

Jeff Boyce
<Access MVP>
 
D

Doug_C

Hi Jeff,

That is the original way I had it set up. It worked like a scrolling
comments field. In otherwords, when a project is selcted from a cbo, it
automatically brings up all comments made under that project in the comments
field sort of like this:
03/12/05 - rgrgrrgrgrgrg
04/22/05 - ggfgfgggfg
07/11/05 - thtthththhh
The problem I am having is when a user click on the "Update Status" button,
it will enter the current date and time and then let them add their comments
but will also allows the user to change or delete any of the previous
comments made. I want them to add as many comments as they like but not
change or delete any of the others. Otherwise, it will affect the next person
reviewing the comments to see how the project is coming along. If you know a
way of accomplishing this, I would be very grateful as I have tried various
things with no success. This is my very last piece. I am a novice at this so
please use simple terms and detailed steps so I can follow along. I do store
all information I learn from this site as reference to try and do things
myself on future databases.

Thank you!!
 
J

Jeff Boyce

Here's an approach that's worked for me...

Rather than using a memo field and "stuffing" date/time stamps and comments
into a single field, I created a "comments" table, related "many" to the
"one" main table. Each comment gets its own record, so each comment gets a
date/time stamp, a "whodunnit" entry, and the comment. You may also be able
to determine the network logon "name" (if you're on a network) of the person
making the entry and preclude them from changing any comment record that
isn't "theirs".

Good luck

Jeff Boyce
<Access MVP>
 
A

Albert D.Kallal

Why not build a bound form that is attached to the same table?

Then, when you pop up the form, the user can edit the existing data also.

just make sure you save the current record BEFORE you launch hits new form.
(you don't need it to be popup..but it should be model).

just build that new form based on the save table with the comments field.
Turn all of the junk (like record selection, allow deletion, navigation
etc).

then go:

me.refresh
docmd.openform "editcomments",,,"id = " & me!id

the above is all you need....
 
D

Doug_C

Hi Albert,

So should I put that code in the open form command button for the pop up
under OnOpen? The &me!id is the id suppose to represent the name of the pop
up form or the main form? Sorry, I am still a novice at this.

Thanks!
 
A

Albert D.Kallal

So should I put that code in the open form command button for the pop up
under OnOpen? The &me!id is the id suppose to represent the name of the
pop
up form or the main form? Sorry, I am still a novice at this.

no, the me!id represents the key field name (usually called id). That extra
command stuff simply tells the form WHAT record to goto and edit.

So, that code I have is to OPEN that form you want to display to edit the
comments box.

So, just build a regular form with a that comments box on it. (you can even
use the wizard if you want). Now, size this form the way you want (as
mentioned, turn off navigation buttons etc, as you don't need that junk).

Now, the only thing you need to do is to open the form to the correct RECORD
to edit this comments box. This form is bound to the same table that we are
working on BEFORE we launch this edit comment box.

So, what was (or where) was the code that opens up the comments editing form
go? (I have to assume you got a button). That button code to show this edit
comments form should now be:

me.refresh
docmd.openform "editcomments",,,"id = " & me!id

That is it!!....two lines of code. As mentored, the above code assumes the
table has a autonumber field named id....
And, of course the above assumes a form called editcomments...but just
change that above to whatever you used.

So, that above code will open up the comments form, and with "where" clause
sends the form to the correct record.
 
D

Doug_C

Sounds Great! I'll give this a try. Now that you simplified it, it's so much
easier to follow. Thank you Albert for your expertise!
 
Top