if and then

  • Thread starter sobeit via AccessMonster.com
  • Start date
S

sobeit via AccessMonster.com

please help

how can i code this right

if me.field.value = "value" then
me.field2.value = ([field3]*[field4]/ 144 "and" "elseif??"
me.field2.value >= 15 then
me.field2.value = 15
end if

the field2 must be at 15minimum

thanks in advance
 
C

Chris O'C via AccessMonster.com

if me.field.value = "value" then
me.field2.value = [field3]*[field4]/144
end if
if me.field2.value < 15 then
me.field2.value = 15 'bump it up.
end if


Chris
Microsoft MVP

please help

how can i code this right

if me.field.value = "value" then
me.field2.value = ([field3]*[field4]/ 144 "and" "elseif??"
me.field2.value >= 15 then
me.field2.value = 15
end if

the field2 must be at 15minimum

thanks in advance
 
S

sobeit via AccessMonster.com

sir it is only 15 on the field2 when the value of the "field" is "value" so
i think it is not a separate code
if me.field.value = "value" then
me.field2.value = [field3]*[field4]/144
end if
if me.field2.value < 15 then
me.field2.value = 15 'bump it up.
end if

Chris
Microsoft MVP
please help
[quoted text clipped - 9 lines]
thanks in advance
 
C

Chris O'C via AccessMonster.com

You're right, that's important. How about using a temporary variable?

Dim temp as double

if me.field.value = "value" then
temp = [field3]*[field4]/144
if temp < 15 then
me.field2.value = 15 'bump it up.
else
me.field2.value = temp
end if
end if


Chris
Microsoft MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top