To create a comment box in the form

Hi everyone,

I would like to create a comment box in my form that can be edited before I run the invoice. Here is what I have done so far. Created the following table.
Record #   Date  EmployeeName ClientName  LaborHrs  Rate  WorkDescription
Then I created a form with drop down box that you can select a client to display a subform with the total hours and the rate and total billings amount.
Then I created a click button "Preview Invoice" with "BeginDate" and "EndDate" to display the line item records through another subform.
I would like to create a comment box within the same form to automatically fills in with the texts from "WorkDescription" records on the screen and be able to edit before I send it to "Pint Invoice".

The invoice looks like this.
 from "date" to "date"  xxx hours  labor at "rate"  total amount

Comment:----------------------Description of the work---------------------------------------

Everything is working fine except the comment box on the form and consequently on the invoice.

I really appreciate your help.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mike EghtebasDatabase and Application DeveloperCommented:
You may want to change field property to memo to type as much you whish.

Include this field, WorkDescription, in your form record source query and add its txtbox to your form where you want to edit it.  If you have issues not to cover very much of your form, let me know to discuss it.

Otherwise, as you navigate through records, WorkDescription ought to appear in txtWorkDescription you just added to your form or subform.  Enter this box and edit it.

If you want to keep WorkDescription intact but use it to crate a comment field, it is better, to add a new field to your table called Comment.  Similar to above procedure, add it to your query and then to your form.

Now, your form will show WorkDescription and an empty txtComment, if you want the comment entered automatically, in on current event of your form or subform where txtComment and txtWorkDescription are:

if(Nz(txtComment,"")<>"" Then  'It will add txtWorkDescription only if txtComment is empty
txtComment =txtWorkDescription   'if you don't need to show txtComment , make it invisible
end if

Or create a button where you can add txtWorkDescription to txtComment on demand, using
txtComment =txtWorkDescription  

Iyou do not want to store the comment in your table, then include the work description in your recordssource, but don't put a bound control on the form.

Put an unbound control on your form and on the On Current event add the statement txtcomment=me.WorkDescription
You will then be able to edit it without it interfering with the text stored in the database.

On the report refer to the form control such as Forms!formname.txtcomment

You would obviously only be able to use the report when the form was open or it will ask you for the value of the comment field.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
vfvAuthor Commented:
Hi Mike & Szacks,

Sorry for late response. I just want to thank you for your comments for solving the problem I am having. I followed your instructions step by step. I am not getting this resolved. I like to give you the lay out of my print invoice form so you would understand what I am trying to accomplish.
When I open form "Print Invoive"
Search Customer  ___Combo Box______      You choose the customer you want to bill
Customer Name ____________________      The customer name will apprear after you choose

The Project SubForm will appear  looks like this:

          Project Name      Total Labor Hours         Total Amount Billied
           Payable Dept.           120                             3,600.00

 Preview Invoice   When you click "Preview Invoice" box the "Project SubForm will be replaced with "Project Detail SubForm"  looks like this:

Begin Date_______________ End Date ________________Comment : To Unload food. To count the inventory. To
                                                                                                      Organize the storage.
           Date      Employee         labor             Work Description
         11/15/04   John                 6                 To unload food.
         11/16/04   James               8                 To count the inventory.
         11/17/04   Garry                4                 To organize the storage.  

Once I type in "Begin Date" and "End Date" the detail listing of the records will appear. I was using the "Comment" box to describe the type of work we've done. Now I like to see the work description to be appeared automatically like you see it above.And be able to go in and edit the wording before I print the invoice.

Thanks for your patience and help.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.