[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


To create a comment box in the form

Posted on 2004-11-17
Medium Priority
Last Modified: 2012-05-05
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.

Question by:vfv
LVL 34

Assisted Solution

by:Mike Eghtebas
Mike Eghtebas earned 500 total points
ID: 12612618
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  


Accepted Solution

szacks earned 500 total points
ID: 12612770
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.

Author Comment

ID: 12627206
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.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question