Results 1 to 5 of 5
  1. #1
    normie is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    53

    Query form question

    I have a form created from a query and I have put this formula in the control source of one form box and it gives me what I need on the form but does not enter the value in the query column...Have I missed a step?



    Query columns : Bay # and TIME IN

    Formula in Time in box on form: =IIf([Bay #],Now(),"")

    Thanks for your time

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,820
    Calculations in textboxes are not saved to fields without code.

    You only want a date saved if Bay# is entered?

    BTW, should avoid use of spaces and special characters and punctuation (underscore is exception) in names. Better would be BayNum, TimeIn or Bay_Num, Time_In.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    normie is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    53
    Yes, When I enter the number in the Bay # box on the form I want TIME IN box to show NOW()

    Also I took your advice and changed Bay # to Bay_Num and TIME IN to TIME_IN

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,820
    I only use VBA. In the AfterUpdate event of Bay_Num control, select [Event Procedure]. Double click the ellipses (...) and this will take you to the procedure in VBA editor. Type code, like:

    If Not IsNull(Me.Bay_Num) Then
    Me.Time_In = Now()
    Else
    Me.Time_In = Null
    End If
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    normie is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    53
    Success,...Thank you for the code that was the first time I have Entered data straight into the VBA screen

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

Similar Threads

  1. Query Question
    By CarlV in forum Access
    Replies: 2
    Last Post: 09-20-2011, 06:25 AM
  2. Form/Query Display Results Question
    By AcmeGearSteve in forum Access
    Replies: 5
    Last Post: 10-12-2010, 01:21 PM
  3. Query Question
    By Guiseppe in forum Queries
    Replies: 5
    Last Post: 03-23-2010, 04:32 PM
  4. Form query question
    By Subotai in forum Forms
    Replies: 1
    Last Post: 02-04-2010, 05:06 PM
  5. Query Question
    By blewis in forum Queries
    Replies: 0
    Last Post: 04-16-2009, 01:37 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