Results 1 to 4 of 4
  1. #1
    ElPerson is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2019
    Posts
    6

    Lightbulb Access Form Correction

    Hi


    **SEE the ATTACHED SCREENSHOT
    I have Access Form and hope you help me with the following
    1>Want the Keep the Fields empty unless i type in them, now every time i start writing the customer name it fill the rest with "0"??
    2>want Access to auto calculate and fill the "Amount to be Paid" based on my entry of the field "Number of Boxes" i mean the "Amount to be paid should be the result of number of boxes *55.5
    3>want the access add the now date at time of data entry



    Click image for larger version. 

Name:	Capture.jpg 
Views:	10 
Size:	61.8 KB 
ID:	38501

    Thank you

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    1. Is DefaultValue property set to 0 for field in table? Remove the 0.

    2. Use an expression in textbox ControlSource property that references the quantity field name, example: =[Quantity]*55.5. Saving this calculated value to table will require code (macro or VBA). There is no need to save in table, calculate when needed.

    3. Is this a Date/Time field in table? Set DefaultValue property to: Now()

    This is all very basic Access functionality. Have you studied an introductory tutorial book?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    ElPerson is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2019
    Posts
    6
    1>The default value was empty and the 0 always showing the field, so i set the default value to "", the 0 disappeared BUT once i start writing in any of the fields in the form it shows the 0 again in the rest of the fields.
    2> i hope to save the result to the table, would you please give me a VBA Please
    3> the date is Done successfully

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    1. If field is number type, using "" should error because that is an empty string and number fields cannot hold empty string. Don't set DefaultValue in table. Make sure the textbox DefaultValue property has nothing in it as well.

    2. Me!Amount = Me.tbxAmount - use your real field and textbox names. The trick is figuring out what event(s) to put code into, perhaps the form BeforeUpdate event. This is a common topic and many examples can be found. Again, advise NOT to do this for such a simple calc.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 04-19-2018, 12:57 PM
  2. Replies: 2
    Last Post: 02-23-2016, 04:42 PM
  3. Re: Correction for Moazzam
    By Jutt123 in forum Modules
    Replies: 1
    Last Post: 10-29-2014, 06:38 AM
  4. Replies: 1
    Last Post: 07-01-2013, 09:46 AM
  5. Code Correction :|
    By hitesh_asrani_j in forum Forms
    Replies: 15
    Last Post: 10-17-2011, 07:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums