Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20
  1. #16
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922

    Should you be using IsDate() instead of Null just in case?

  2. #17
    akino25 is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2013
    Posts
    10
    Quote Originally Posted by Bulzie View Post
    You need to also limit it to just those without values already so your Where clause would be:

    WHERE (((No_HOP_BNC.Date_HOP) Is Not Null) AND ((No_HOP_BNC.Texte19) Is Null));"

    Also do aRequery at the end to have it display on the form after you hit the button and do the Update.

    Forms![No_HOP_BNC].Requery
    Hi Bulzie, thank you for those reply,

    I`m still very noob into those sort of thing, but what I know is the form is linked to a table called No_HOP_BNC (as you can see in the code)
    and adding a requery would be hard for me to do so (or don`t really understand how i should approach it)

    I found this way can make the job done:
    Click image for larger version. 

Name:	Capture.PNG 
Views:	8 
Size:	2.5 KB 
ID:	25556
    with this code,

    the user will first have to enter the 8 digits in the No BC first, and whenever the user click on the date box, today`s date will be entered and also the 8 digits from the No BC will ba pasted.

    It`s not what I wanted ayt first but i guess it can make the job done,
    It seems more professional, having to click a button and then fill out the field where it contains a date though.

    see below when i click on the date box, No BC will be filled up for me
    but i ll have to click on every row to make it happens, instead of 1 click of a button and filled out for me
    Click image for larger version. 

Name:	Capture.PNG 
Views:	8 
Size:	6.7 KB 
ID:	25557

  3. #18
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,471
    Not sure where the translation is off. I tested the below and it works. The code below directly updates the table with the value in the text box. It does not enter them through the form. Then the Requery refreshes the screen so those values now show on your form. Get rid of the other stuff in the OnClick of the Test button and paste in the 4 lines of code below.

    DoCmd.SetWarnings = False
    DoCmd.RunSQL "UPDATE No_HOP_BNC SET No_HOP_BNC.texte19 = [Forms]![YourFormName]![txt_BC] WHERE (((No_HOP_BNC.Date_HOP) Is Not Null) AND ((No_HOP_BNC.Texte19) Is Null));"
    Forms![YourFormName].Requery
    DoCmd.SetWarnings = True

    In the above code:
    1. Replace YourFormName with the actual name of your form.
    2. texte19 is the name of your text box.
    3. txt_BC is the field in your table you are writing this value.
    4. No_HOP_BNC is the name of the table
    5. Date_HOP is the name of the date field

  4. #19
    akino25 is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2013
    Posts
    10
    Quote Originally Posted by Bulzie View Post
    You need to also limit it to just those without values already so your Where clause would be:

    WHERE (((No_HOP_BNC.Date_HOP) Is Not Null) AND ((No_HOP_BNC.Texte19) Is Null));"

    Also do aRequery at the end to have it display on the form after you hit the button and do the Update.

    Forms![No_HOP_BNC].Requery
    I don`t understand what you mean by aRequery: here`s what the code is in the test button so far,
    but the code seems to be bugging in that line:



    Click image for larger version. 

Name:	Capture.PNG 
Views:	8 
Size:	8.6 KB 
ID:	25559

  5. #20
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,471
    Reread Post #18, remove that code in the button and replace with the 4 lines I indicated in Post #18. Make sure to read all I wrote and change YourFormName with the actual name of your form.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 20
    Last Post: 10-13-2015, 09:05 AM
  2. Replies: 3
    Last Post: 07-07-2015, 12:29 PM
  3. Replies: 2
    Last Post: 12-14-2013, 08:40 AM
  4. Replies: 1
    Last Post: 08-23-2013, 10:15 AM
  5. Importing 4 digit field as date
    By tagteam in forum Access
    Replies: 9
    Last Post: 06-13-2013, 02:34 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