Results 1 to 5 of 5

Thread: Autofill

  1. #1
    Join Date
    Nov 2002
    Location
    Melbourne
    Posts
    92

    Unanswered: Autofill

    I have a Amount and ChargeCode field in a subform

    What I would like if is for Code field to fill with 01 if a dollar amount is entered in the Amount field.

    The code stays at 01 until user need to change the charge code depending which charge code with be used to pay for an item.


    eg

    If Amount field is $15.00 then ChargeCode is 01


    any thoughts anyone!

  2. #2
    Join Date
    Jan 2003
    Location
    Vietnam
    Posts
    188

    Re: Autofill

    Originally posted by billjov
    If Amount field is $15.00 then ChargeCode is 01

    any thoughts anyone!
    add this line to Amount_AfterUpdate event (assuming that you control name share the same name as above

    if me.Amount > 0 then me.ChargeCode = "01"

    hope this helps
    qha_vn

  3. #3
    Join Date
    Nov 2002
    Location
    Melbourne
    Posts
    92
    When I tried your suggestion I get a error message : cant assign a value to this object.

  4. #4
    Join Date
    Nov 2002
    Location
    Melbourne
    Posts
    92
    Might be easier if I just set the default to 01. As a new record is created in the subform, the value in the ChargeCode field is set to 01.

    Do I set the Format to 00 and then set the default value on the properties of the field to 01.

    What what type of field size do I need. At the moment I have the data type as Long integer and the format 00.


    Hows the weather over there! I have a collegue who work at the immigration office in your country. She loves your country.!

  5. #5
    Join Date
    Jan 2003
    Location
    Vietnam
    Posts
    188
    Originally posted by billjov
    1- Might be easier if I just set the default to 01. As a new record is created in the subform, the value in the ChargeCode field is set to 01.

    2- Do I set the Format to 00 and then set the default value on the properties of the field to 01.

    What what type of field size do I need. At the moment I have the data type as Long integer and the format 00.


    3- Hows the weather over there! I have a collegue who work at the immigration office in your country. She loves your country.!
    1- yes mate, set default value to 1 is also a good idea

    2- am worrying about Long Integer field with that format, if you really want the format 00, 01, 02... and you have less then 99 ChargeCode then i would suggest you use Text(2) for that field

    3- nice to hear that, now is the raining season, many people come here and love our country... if you have a chance to come here, let me know, i would definitely show you around.

    take care
    qha_vn

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •