Results 1 to 6 of 6
  1. #1
    ngluvakov is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2017
    Posts
    4

    I need help with data input


    I made a table containing following fields:
    Click image for larger version. 

Name:	Screenshot_1.jpg 
Views:	15 
Size:	86.8 KB 
ID:	30159

    In number of edits I enter integer value. Tied to this table is another where I enter who did work and on what edit number:
    Click image for larger version. 

Name:	Screenshot_2.jpg 
Views:	15 
Size:	91.0 KB 
ID:	30160
    I need to restrict this entry to value less or equal to the value in previous table. How to make that? At this moment I can type in any value and it would work.

    Thank you guys in advance. This is my first encounter with access and this forum. I am grateful on your time.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    in a continuous entry form, have the the limit value show in a textbox in the header.
    The query for the form would pull both table data.
    in the main entry form, set the BeforeUPDATE event for tWorkDone.EditNumber textbox.

    Code:
    sub EditNumber_BeforeUpdate(Cancel As Integer)
    if  EditNumber  > me.txtLimit then
       msgbox "You cannot enter value larger than " & me.txtLimit
       cancel = true
    endif
    end sub

  3. #3
    ngluvakov is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2017
    Posts
    4
    Thank you for answer Ranman256. Where do I input the code? I have tried to put calculated in data type, but it doesn't work or recognize expressions. For now, I only know how to use GUI. That's the reason why my interaction with the software is very limited.

  4. #4
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    In the properties window, look for beforeupdate.

    Click on add code and add the case in the window that opens.

  5. #5
    ngluvakov is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2017
    Posts
    4
    Thank you all for your help! This forum is really good!

    I have tried, but it doesn't work. I found it only under form events. Does it mean that I can't have it in table? I am including the database.
    Test.zip

  6. #6
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    What have you tried? Your database doesn't seem to contain any of the above suggestions.

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

Similar Threads

  1. How to restrict data input.
    By Yodo in forum Access
    Replies: 3
    Last Post: 06-15-2017, 04:35 AM
  2. Replies: 3
    Last Post: 01-05-2015, 02:21 PM
  3. Adding input data
    By RickieV in forum Programming
    Replies: 2
    Last Post: 07-27-2014, 04:45 PM
  4. Data Type to input data number
    By TioAdjie in forum Access
    Replies: 5
    Last Post: 02-17-2014, 11:21 AM
  5. Replies: 3
    Last Post: 08-07-2013, 06:03 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