Results 1 to 2 of 2
  1. #1
    dave john is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    6

    Unhappy autofill a field base on the conditions of other fields

    Hi im creating a data base that has a lot of calculations


    well the problem is; i have a field [sub class] where i will enter either sb-1, sb-2 or sb-3, and so on... next i have a field [marketvalue], now if i enter sb-1 in [sub class] field i want that [marketvalue] to automatically enter 200 and if i enter sb-2 in [sub class] the [maketvalue] must be field with 300.....


    any idea???
    Please help me guys this project means a lot to me.... pls.... pls.... pls...

  2. #2
    Rod is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Location
    Metro Manila, Philippines
    Posts
    679
    Too many 'sb-1' type possibilities for IIf() to be a practical solution!

    OK, I think you are at the point of having to write a small procedure such as (off the top of my head):

    Select Case Nz([sub class], "")
    Case "sb-1"
    marketvalue = 200
    Case "sb-2"
    marketvalue = 300
    ...
    ...
    Case Else
    marketvalue = 0
    End elect

    Place this in a private sub in the form's module and invoke it from the form's On Current and the [sub class] before update events.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. autofill of fields
    By knuccio in forum Access
    Replies: 1
    Last Post: 08-16-2012, 05:16 PM
  2. Replies: 3
    Last Post: 08-01-2012, 10:56 AM
  3. Replies: 1
    Last Post: 02-04-2011, 04:58 AM
  4. Autofill form fields based on another field
    By ljs1277 in forum Access
    Replies: 3
    Last Post: 02-16-2010, 02:51 PM
  5. Autofill form fields
    By roboticsguy1988 in forum Forms
    Replies: 1
    Last Post: 08-10-2009, 08:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums