473,406 Members | 2,956 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,406 software developers and data experts.

Calculated field

Hi

I have a bond fields database winform app. How can I calculate a field form
one of the bound fields and show on form?

Thanks

Regards
Oct 13 '08 #1
6 2316
John,

I am an expert in cryptic answers, however in this case you are an expert in
my idea in cryptic questions.

Cor

"John" <in**@nospam.infovis.co.ukschreef in bericht
news:O3**************@TK2MSFTNGP06.phx.gbl...
Hi

I have a bond fields database winform app. How can I calculate a field
form one of the bound fields and show on form?

Thanks

Regards

Oct 14 '08 #2
I have a bound form...Ok?

However..one of the field does not need to be bound instead calculated from
one of the bound fields...how to do it?

Let's say DOB is coming from a bound field? How to setup a Age field which
calculates from DOB?

Regards

"Cor Ligthert[MVP]" <no************@planet.nlwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
John,

I am an expert in cryptic answers, however in this case you are an expert
in my idea in cryptic questions.

Cor

"John" <in**@nospam.infovis.co.ukschreef in bericht
news:O3**************@TK2MSFTNGP06.phx.gbl...
>Hi

I have a bond fields database winform app. How can I calculate a field
form one of the bound fields and show on form?

Thanks

Regards


Oct 14 '08 #3
This tip is not completely the same, however, you can do this normally using
the currency events

http://www.vb-tips.com/DataBindingEvents.aspx

Cor
"John" <in**@nospam.infovis.co.ukschreef in bericht
news:eQ**************@TK2MSFTNGP04.phx.gbl...
>I have a bound form...Ok?

However..one of the field does not need to be bound instead calculated
from one of the bound fields...how to do it?

Let's say DOB is coming from a bound field? How to setup a Age field which
calculates from DOB?

Regards

"Cor Ligthert[MVP]" <no************@planet.nlwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
>John,

I am an expert in cryptic answers, however in this case you are an expert
in my idea in cryptic questions.

Cor

"John" <in**@nospam.infovis.co.ukschreef in bericht
news:O3**************@TK2MSFTNGP06.phx.gbl...
>>Hi

I have a bond fields database winform app. How can I calculate a field
form one of the bound fields and show on form?

Thanks

Regards



Oct 14 '08 #4
If your class is custom, (i.e. not generated from entity model), a simple
method is to add a readonly property to the class and put custom code in the
getter. I just run into this myself with Format event not firing on a
binding and can not figure out why (inside the new datarepeater control).
So I used a calculated property instead and bind to that. Works well and
imo is cleaner.

"John" <in**@nospam.infovis.co.ukwrote in message
news:eQ**************@TK2MSFTNGP04.phx.gbl...
>I have a bound form...Ok?

However..one of the field does not need to be bound instead calculated
from one of the bound fields...how to do it?

Let's say DOB is coming from a bound field? How to setup a Age field which
calculates from DOB?

Regards

"Cor Ligthert[MVP]" <no************@planet.nlwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
>John,

I am an expert in cryptic answers, however in this case you are an expert
in my idea in cryptic questions.

Cor

"John" <in**@nospam.infovis.co.ukschreef in bericht
news:O3**************@TK2MSFTNGP06.phx.gbl...
>>Hi

I have a bond fields database winform app. How can I calculate a field
form one of the bound fields and show on form?

Thanks

Regards


Oct 14 '08 #5
John wrote:
I have a bound form...Ok?

However..one of the field does not need to be bound instead
calculated from one of the bound fields...how to do it?

Let's say DOB is coming from a bound field? How to setup a Age field
which calculates from DOB?
If you are binding to a datatable, you can add a calculated column to the table,
and then bind a form control to the calculated column. Lookup
DataColumn.Expression to see what kind of calculations you can do, and what the
syntax is. Age is not a great example, by the way, since it changes every second
(and always in the direction of older, dang it all).
Oct 15 '08 #6
Steve,

You are right, in my opinion the best solution too.

Cor

"Steve Gerrard" <my********@comcast.netschreef in bericht
news:Rv******************************@comcast.com. ..
John wrote:
>I have a bound form...Ok?

However..one of the field does not need to be bound instead
calculated from one of the bound fields...how to do it?

Let's say DOB is coming from a bound field? How to setup a Age field
which calculates from DOB?

If you are binding to a datatable, you can add a calculated column to the
table, and then bind a form control to the calculated column. Lookup
DataColumn.Expression to see what kind of calculations you can do, and
what the syntax is. Age is not a great example, by the way, since it
changes every second (and always in the direction of older, dang it all).


Oct 15 '08 #7

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

Similar topics

1
by: Norbert Lieckfeldt | last post by:
MS Access 2002 here. I am just trying to set up a simple database for a friend who's an optician. Basically, all clients with address details, date of last eyetest and a drop-down combo box to...
2
by: hhathome | last post by:
In my report I have a calculated DateDiff Field, I also have a calculated count field. I'm trying to get a total of the DateDiff field and dividing it by the count field and I'm having problems --...
2
by: markm75c | last post by:
Does anyone know of a way to sort a column which isnt databound or an actual field in the database, but is derived from a method? IE. I have a grid showing stats for softball, with a calculated...
2
by: ey.markov | last post by:
Greetings, in A2K VBA, I set the following recordset: Set rsGPValue = dbs.OpenRecordset("SELECT *, DateSerial(Year(),Month()+4,0) FROM tblGPValue AS OurDate, dbOpenSnapshot) and then I try...
3
by: kelley.l.turner | last post by:
Hi all, I am very new to MS Access so please bear with me! I have created a simple calculated field in my data entry form, yet when I view my data table or try to generate a report based on...
5
by: Henrik | last post by:
The problem is (using MS Access 2003) I am unable to retrieve long strings (255 chars) from calculated fields through a recordset. The data takes the trip in three phases: 1. A custom public...
2
by: jcf378 | last post by:
hi all. I have a form which contains a calculated control ("days") that outputs the # of days between two dates (DateDiff command between the fields and ). However, when I click "Filter by...
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...
3
by: Matthew Wells | last post by:
If I have a calculated field that returns a value from a udf, does that field get calculated even when it's not being used in a Select statement? I knw that if a calculated field's formula is...
2
by: mkbrady | last post by:
I have a query that includes calculated fields that generate numeric results. I have wrapped conversion functions CLng() and CDdl() around the calculated fields to ensure the data types are...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.