Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 32
  1. #16
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I have never used LostFocus. Maybe should use AfterUpdate?



    What is dteDepDate - a public variable?
    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.

  2. #17
    willkr is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2023
    Posts
    110
    Yes, dteDepDate is a public variable. I have it defined as:

    ' Date of current Deposit
    Public dteDepDate As Date

    I'll try AfterUpdate

  3. #18
    willkr is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2023
    Posts
    110
    I tried using
    Private Sub Date_AfterUpdate()

    but it never gets to this either

  4. #19
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Are you sure it doesn't run? Might run and error and kick straight to the error handler. Disable error handler and set a break point in the procedure to debug.
    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. #20
    willkr is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2023
    Posts
    110
    OK, it works now! I have found that at times I have to exit the application completely and start it up again before some of the changes work. wierd!!!

  6. #21
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Make sure the code is associated with the event:

    https://baldyweb.com/FirstVBA.htm

    Also note that Date is a reserved word, it's the name if a function. Access can get confused so it's better not to be used as a field or control name.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #22
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Arg, didn't realize there was another page of replies.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #23
    willkr is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2023
    Posts
    110
    Thanks pbaldy,
    I have changed the control name for date on the forms to depdate.

    Now I have another problem. When i modify a savings deposit, I display all the deposits and when one of them is double-clicked, I open up another form with that deposit and it's specific data. The form is supposed to have specific data about that savings deposit and in the form design all the fields are there. However, nothing in the "Detail" section of the form shows up, just the header and footer. I looked in the design view and the "Detail" section is set to Visible=Yes and Display When=Always. What am I missing?

  9. #24
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    That typically happens when there are no records to display and you can't add a new record. Double check your wherecondition.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  10. #25
    willkr is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2023
    Posts
    110
    I don't have a WHERE clause. I'll try adding one

  11. #26
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    What is the code behind the double click of the item you want to open?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  12. #27
    willkr is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2023
    Posts
    110
    Here's the code that gets executed from a double-click

    '------------------------------------------------------------
    ' Modify Savings Deposit
    '
    '------------------------------------------------------------
    Private Sub ModifySavingsDeposit()
    On Error GoTo Err_ModifySavingsDeposit


    Dim stDocName As String
    Dim stLinkCriteria As String


    lngSavingsDepositNumber = Me.[Number]
    blnTransRecon = Me.Cleared
    dteTransDate = Me.[DepDate]
    strSavingsAccount = Me.Account
    curTransAmount = Me.Amount

    stDocName = "frmShowSavingsDepositEntries"
    stLinkCriteria = "[Savings Deposit Number]=" & Me![Number]
    DoCmd.OpenForm stDocName, , , stLinkCriteria

    Exit_ModifySavingsDeposit:
    Exit Sub


    Err_ModifySavingsDeposit:
    MsgBox Err.Description
    Resume Exit_ModifySavingsDeposit

    End Sub

  13. #28
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    That's a wherecondition. Use this :

    https://www.baldyweb.com/ImmediateWindow.htm

    on the stLinkCriteria variable and see if it's what you expect. Also:

    https://www.baldyweb.com/wherecondition.htm

    In case the data type isn't numeric.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  14. #29
    willkr is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2023
    Posts
    110
    The savings deposit number is numeric and it shows up on the form, but none of the other controls show up and the subform doesn't show up.

  15. #30
    willkr is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2023
    Posts
    110
    In the form_open section I have the following:

    Me.[Savings Deposit Number] = lngSavingsDepositNumber
    Me.Cleared = blnTransRecon
    Me.SvgsDepDate = dteTransDate
    Me.[Account] = strSavingsAccount
    Me.[Total Amount] = curTransAmount

    ' Refresh Screen
    Me.Refresh


    Again, the only thing that shows up is the Savings Deposit Number

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

Similar Threads

  1. Replies: 6
    Last Post: 08-17-2021, 08:42 AM
  2. Replies: 17
    Last Post: 05-10-2020, 09:49 AM
  3. Replies: 4
    Last Post: 08-24-2016, 06:48 AM
  4. Replies: 3
    Last Post: 01-20-2014, 09:04 AM
  5. Replies: 3
    Last Post: 01-05-2012, 12:04 PM

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