473,395 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Access not regognize field value change when its calculated by VB

Hi

Is there any good ideas how to update form vb code always after some values
are changed / added by vb (not user).

I have some code behind subforms vb and there are calculations behind
"Form_Current" section those I need to re-calculate after some values are
changed or added.

The problem is that if list box value is calculated in vb, access wont
regognize that valua has changed.

Simple example:
There are 4 "list box" objects in the form.
- user_input_box_01
- user_input_box_02
- vb_calculated_box_01
- sum_of_user_input_and_vb_calculated_01

**This code is behind every 4 objects**
Private Sub <some_of_those_4_objects>_AfterUpdate()
Form_Current
End Sub

**This code is behind form_current**
Dim var_user_input_box_01, var_user_input_box_02
var_user_input_box_01 = Me.user_input_box_01.Value
var_user_input_box_02 = Me.user_input_box_02.Value

Me.vb_calculated_box_01.Value = var_user_input_box_01 +
var_user_input_box_02

Dim var_vb_calculated_box_01
var_vb_calculated_box_01 = me.vb_calculated_box_01
me.sum_of_user_input_and_vb_calculated_01.value = var_user_input_box_01 +
var_vb_calculated_box_01

**End of code behind form_current**
How it works:
User gives values in "user_input_box_01" and "user_input_box_02"
After "user_input_box_02" value is entered "vb_calculated_box_01" value is
calculated correctly, but.... "sum_of_user_input_and_vb_calculated_01" is
empty.

When I click to "vb_calculated_box_01" or
"sum_of_user_input_and_vb_calculated_01" box -->
"sum_of_user_input_and_vb_calculated_01" value is calculated correctly.

Also if I change user values, "vb_calculated_box_01" value is calculated
correctly, but.... "sum_of_user_input_and_vb_calculated_01" is calculated by
previous user values until I click "vb_calculated_box_01" or
"sum_of_user_input_and_vb_calculated_01"..
How it should works:
Some code or etc. function that I donīt need always to click those boxes
would be very nice =)
Regards,
Henry
Nov 12 '05 #1
0 2061

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: MX1 | last post by:
I have query2 that sums a set of fields from query1. Works fine. However, when I try to add two of the calculated fields from query2, I get prompted for the label I gave the fields. I just hit...
9
by: Colin McGuire | last post by:
Hi, I have an report in Microsoft Access and it displays everything in the table. One column called "DECISION" in the table has either 1,2, or 3 in it. On my report it displays 1, 2, or 3. I want...
7
by: Ruben Baumann | last post by:
Just wondered if anyone has had occasion to use, or does use, FileMaker, or Raining Data's Omnis, or Alpha5's software, and how they compare with Access? Ruben
5
by: jillandgordon | last post by:
I hope this group does not mind the most basic questions. I am trying to teach myself Access in two different versions. My company now uses Access 97 but, in the next few months, will be...
7
by: manning_news | last post by:
I've got a report that's not sorting correctly. I build a SQL statement and assign it to the recordsource in the Open event, sorting the data the way the user chooses. The user can choose up to 3...
4
by: alexandre.brisebois | last post by:
Hi, I am using access 2003, I would like to know if there is an option to reorganize the tables in a maner that is readable, as we can do in sql sever 2000 or 2005. I have been given a database...
9
by: Haas C | last post by:
Hi all! Is there anyway I can override a value in a calculated field on a form? For example: I have a form which displays the following fields based on a query: Premium Due field has the...
13
by: Ulv | last post by:
I have a table (TblItems) with fields Lenght, Width and Height as decimalfields. I also have the fields Desc, a text field. In a form I have created this line of code after updating: Desc =...
2
by: Deac | last post by:
I have two Access 2003 tables, one has a "Zone" and "Lot1SqFt" that changes with each record. (8,000+ records) A portion of this table: CustomerID ZONE Lot1SqFt SqFtPrice ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.