validation value in form?

cikwan82

Registered User.
Local time
Today, 15:45
Joined
Dec 10, 2013
Messages
45
Hi,
i have little bit problem in access here, if i want to create two textbox... first textbox for time and second textbox for unit. when i type (time) in first textbox ,second textbox will appear automatically the unit number...

exampel


1textbox-----------2textbox

1<time<=60 ------- 1 unit
60<time<=120 ------ 2 unit
120 < time <= 180 ------- 3 unit

please help me brothers...
 
Unit will be a calculated field, not a stored one.
Code:
=Int(([TimeField]+59)/60) & IIF([TimeField] Between 1 And 60," unit"," units")
 
Last edited:
Thank you my friend,, you are awesome.. but it is posibble the unit will appear automatically without push button enter?

Thank you.
 
Just put the expression in the ControlSource property of the second textbox. It will change automatically when the first textbox updates.

BTW. Between is SQL. It does not work in VBA functions such as IIF.
 
Thank you bro.. it already done...
I have different question.. simple.. why when i plus different text box in the form field it going like this...

example

[Price1] + [Price2] = [Total text box]

[30] + [40] = 3040

what i'm doing is, i just type "= [Price1] + [Price2]" in control source total text box..
why the total 3040... it not going 70 ????:confused:
 
[30] + [40] = 3040

what i'm doing is, i just type "= [Price1] + [Price2]" in control source total text box..
why the total 3040... it not going 70 ????:confused:
Because you are adding text values.
You can use CInt, CLng, CDbl, CCur to convert it to number values, (look in the MS-Access Help file for Type Conversion Functions).
Code:
=CCur([Price1])+CCur([Price2])
 
Oh.. you thank bro.. i really newbies in access ... you a good guy.. Thank again. :)
 

Users who are viewing this thread

Back
Top Bottom