Results 1 to 5 of 5
  1. #1
    Carlito is offline Novice
    Windows 11 Access 2013 64bit
    Join Date
    Aug 2022
    Posts
    1

    Veldwaarde verhogen

    Ik ben een beginner met de Access Database en probeer alles zoveel mogelijk zelf uit te vinden maar soms kom ik er niet uit. Ik heb een databaseje gemaakt waarin velden met veldnamen als uurloon, totaal uren, .70 km ja/nee, totaal bedrag.


    Ik heb het voor elkaar dat als ik de totaal aantal uren invul het bedrag verschijnt dat uit de vermenigvuldiging komt van totaal aantal uren * uurloon. Nu wil ik graag dat als het veld >70 km op ja staat er automatisch 25 euro bij het totaal bedrag wordt opgeteld. Bij nee in dat veld alleen het bedrag van de Totaal uren*uurloon.
    Ik krijg het zelf niet voor elkaar. Mogelijk is dit voor jullie een zeer domme vraag maar ik moet ergens beginnen

  2. #2
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,001
    And for our mainly English speaking members:

    I am a beginner with the Access Database and try to invent everything myself as much as possible but sometimes I can't figure it out.
    I have created a database in which fields with field names such as hourly wage, total hours,.70 km yes /no, total amount.
    I have managed that when I enter the total number of hours, the amount that comes from the multiplication of total number of hours * hourly wage appears.

    Now I would like that if the field >70 km is on yes, 25 euros will automatically be added to the total amount.
    If no in that field only the amount of the Total hours*hourly wage.

    I can't do it myself. This may be a very stupid question for you but I have to start somewhere
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    xps35's Avatar
    xps35 is online now Competent Performer
    Windows 10 Office 365
    Join Date
    Jun 2022
    Location
    Schiedam, NL
    Posts
    229
    In een query
    Code:
    SELECT uurloon, [totaal uren], [> 70 km], [uurloon]*[totaal uren]+IIf([> 70 km],25,0) AS bedrag FROM JouwTabel;
    Overigens kan je beter geen spaties en speciale tekens (zoals >) gebruiken in veldnamen.

  4. #4
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,557
    Hi

    In the query that the Form is based on add a new column with the following:-

    =IIF([>70] = -1,[Total Number of Hours] ,[Total Number of Hours] +25)
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

  5. #5
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,857
    Quote Originally Posted by mike60smart View Post
    Hi

    In the query that the Form is based on add a new column with the following:-

    =IIF([>70] = -1,[Total Number of Hours] ,[Total Number of Hours] +25)
    I thought I had already shown you that you do not need to test a boolean value for true? Just the if field/variable is enough?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

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

Tags for this Thread

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