Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7504629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T21:38:22+00:00 2026-05-29T21:38:22+00:00

I want a text box to contain data which is a calculation based on

  • 0

I want a text box to contain data which is a calculation based on 2 other control field values – only if it’s value is null (ie the current value of the column in the database is null).

So I entered =([control1]*[Control2])/1000 in the expression builder for the default value property – however the result always shows the textbox to be empty (even tho control2 and control2 contain values).

How can I achieve this? Can such an operation only be done in code-behind ie VB??

thanks,

KS

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T21:38:23+00:00Added an answer on May 29, 2026 at 9:38 pm

    I think you’re talking about a control bound to a field in the form’s record source. And when the underlying field is Null, you want the control loaded with your calculated value.

    If that interpretation is correct, you can do it from the form’s On Current event.

    If IsNull(Me.txtYourTextBox) Then
        Me.txtYourTextBox = (Nz(Me.control1) * Nz(Me.Control2)) / 1000
    End If
    

    That will load the computed value into the text box, allow the user to change its value if desired, and store the value to the bound field when the record is saved.

    If the bound field is not Null, its value will be displayed in the text box without alteration by the On Current code.

    Is that what you want?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to replace the 'client' field text box in fogbugz when you edit
I want to validate the value a user enters in a text box, so
I have a text box on a web page, whose value I want to
If I want to validate that a text box contains an integer greater than
I want to have a text box that the user can type in that
i want to make a text box like stackoverflow have for the tag at
I want to have a small text box with a scroll bar that will
I want a simple form with one text box and a submit button. For
I want to code a key press event to a text box to accept
I have a text-box, and I want to enter a string in language A

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.