Typing info into text box

  • Thread starter Thread starter Konstabel
  • Start date Start date
K

Konstabel

Hi,

I have a text box of wich the value depens on a yes no answer, it is either
an hourly tariff or daily. These values are looked up with an sql statement
and then the appropriate one chosen with the statement

=IIf([day tarif]=0;[unit price];[Day Rate])

where [day tarif] is the yes/no answer.

What I would like to know is, how can I be able to type in a value as the
answer if I would like it to be different for a specific case.

Thanks
 
if I was faced with this I would do the following:

Have a combo box for the day tarif where you can choose 'yes' or 'no' and
have a second combo box that changes the list of rates depending on whether
you chose yes or no. It is called a 'cascading combo'. I wouldn't be more
nervous of entry errors with a text box.
 
Hey thanks, I'll try.

But how does that solve my problem of being able to use values that are not
in the list?

scubadiver said:
if I was faced with this I would do the following:

Have a combo box for the day tarif where you can choose 'yes' or 'no' and
have a second combo box that changes the list of rates depending on whether
you chose yes or no. It is called a 'cascading combo'. I wouldn't be more
nervous of entry errors with a text box.

Konstabel said:
Hi,

I have a text box of wich the value depens on a yes no answer, it is either
an hourly tariff or daily. These values are looked up with an sql statement
and then the appropriate one chosen with the statement

=IIf([day tarif]=0;[unit price];[Day Rate])

where [day tarif] is the yes/no answer.

What I would like to know is, how can I be able to type in a value as the
answer if I would like it to be different for a specific case.

Thanks
 
Just add the rates to the table as appropriate. The only reason I suggest
this is that with different tarifs are you using decimal or integer? If you
want to use a text box then you would need post entry verification to check
whether the number entered is correct (and that is too messy in my mind!)

Konstabel said:
Hey thanks, I'll try.

But how does that solve my problem of being able to use values that are not
in the list?

scubadiver said:
if I was faced with this I would do the following:

Have a combo box for the day tarif where you can choose 'yes' or 'no' and
have a second combo box that changes the list of rates depending on whether
you chose yes or no. It is called a 'cascading combo'. I wouldn't be more
nervous of entry errors with a text box.

Konstabel said:
Hi,

I have a text box of wich the value depens on a yes no answer, it is either
an hourly tariff or daily. These values are looked up with an sql statement
and then the appropriate one chosen with the statement

=IIf([day tarif]=0;[unit price];[Day Rate])

where [day tarif] is the yes/no answer.

What I would like to know is, how can I be able to type in a value as the
answer if I would like it to be different for a specific case.

Thanks
 
Essentially what he is saying is that the combo box would be bound to
your field in the table.

By selecting checked or not it would change the selectable values for
that combo box.

If you then said in the properties in that combo box that the value
did NOT have to be in the list you could then sit in that field and
change the value to anything you wanted.

If you don't want to have a combo you can still use a text box but
instead of having the "=IIf([day tarif]=0;[unit price];[Day Rate]) "
statement in the record source you would leave that part blank.

Instead in the afterupdate event of the checkbox (your yes or no
field) you would say something like.

if me.nameofcheckboxfield = 0 then
me.textboxname = [unit price]
else
me.textboxname = [day rate]
endif

The above is just a guess because we don't know the names of the
fields for the checkbox, or the unitprice or the dayrate fields.

essentially you are change the field to be loaded with information on
the change in the value of the checkbox. But this they will also allow
you to override that value with whatever you want.

Ron
 

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

Back
Top