Results 1 to 2 of 2
  1. #1
    tlkng1 is offline Novice
    Windows Vista Access 2007
    Join Date
    Nov 2014
    Posts
    12

    Need help forming an If-Then-Else Statement

    Good morning...



    Let's see if I can make this somewhat simple

    1. I have four data fields in a table; one is data type text (call it alpha); two others are data type number (call them bravo and charlie respectively) and field delta is data type number formatted as percent.

    By written English type coding I need:

    If alpha = "complete"
    Then delta = 100%
    Else delta = charlie divided by bravo *100

    2. I need to link a field to a subsheet that brings up definitions. For example, if someone clicks on the field to enter information, in this case functional requirements (in form FR-001...), a subsheet opens up with a list of definitions; this is specifically referring to a list of functional requirements for system development. It isn't a drop-down to select list but just an information page so the person entering the data can make sure they are entering the proper functional requirement.

    For examle, the functional requirements table reads (think columns)

    Functional Requirement ...........................Description
    FR-001............................................... ....System must do something

    When the user clicks on the Functional Requirements Field in the database, this table with the definitions would open as a subsheet.

    Thanks

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    if using vb code on text boxs as user inputs:
    Code:
    if txtAlpha = "complete" then
       txtDelta = 1
    else
       txtDelta = txtCharlie/txtBravo       'you said formated as % so youd use decimals
    end if

    if using a query to update all recs:
    UPDATE tTable SET WHERE (((tTable.alpha)="Complete") AND ((tTable.delta)=1)) OR (((tTable.alpha)<>"Complete") AND ((tTable.delta)=[charlie]/[bravo]));

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

Similar Threads

  1. need help with sql statement
    By burrina in forum Forms
    Replies: 21
    Last Post: 02-03-2013, 02:57 PM
  2. iif Statement Help
    By smc678 in forum Forms
    Replies: 8
    Last Post: 12-11-2012, 11:02 AM
  3. Need help with a Like statement
    By itm in forum Queries
    Replies: 3
    Last Post: 10-22-2012, 12:55 PM
  4. if statement in sql statement, query builder
    By 54.69.6d.20 in forum Access
    Replies: 4
    Last Post: 09-11-2012, 07:38 AM
  5. Replies: 7
    Last Post: 08-17-2011, 01:49 PM

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