Results 1 to 6 of 6
  1. #1
    Kundan is offline Competent Performer
    Windows XP Access 2013 32bit
    Join Date
    Mar 2018
    Posts
    155

    Regarding Forms

    I have put a condition in the ‘On Current ‘ Event of a Form. When I open the Form I do not see the condition being applied on the first record that is visible. When I begin navigating through the records I see the condition being applied. How to ensure that the condition will be applied even on the first record when the form is opened?


  2. #2
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Sounds like you're not seeing the effect because you don't refresh or requery the form after the change. The clue is
    When I begin navigating through the records I see the condition being applied
    Moving off of a record is one of the ways to commit any record update or append without explicitly doing so in event code. If this isn't the case here, you'll have to elaborate as your description of the situation is a bit vague.

    A simple way to commit your change could be something like IF Me.Dirty Then Me.Dirty = False
    That can cause your form to automatically reflect the change, but as I said, not much info in your post to go on, so I'm not sure.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,016
    I assume by 'put(ting) a condition' you mean that you're trying to conditionally format the Records. Knowing the exact code you're using for this conditional formatting might help us help you...but since moving thru the Records makes it work, you could try this:

    Code:
    Private Sub Form_Load()
      DoCmd.GoToRecord , , acLast
      DoCmd.GoToRecord , , acFirst
    End Sub

    and see if this helps.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  4. #4
    Kundan is offline Competent Performer
    Windows XP Access 2013 32bit
    Join Date
    Mar 2018
    Posts
    155

    Regarding Forms

    Quote Originally Posted by Missinglinq View Post
    I assume by 'put(ting) a condition' you mean that you're trying to conditionally format the Records. Knowing the exact code you're using for this conditional formatting might help us help you...but since moving thru the Records makes it work, you could try this:

    Code:
    Private Sub Form_Load()
      DoCmd.GoToRecord , , acLast
      DoCmd.GoToRecord , , acFirst
    End Sub

    and see if this helps.DBCHECK.accdbLinq ;0)>
    DBCHECK.accdb

    The Form 'Transactions' in the attached DB when opened shows both 'Recvd' & 'Paid' fields as enabled. This is not right . It should show either 'Recvd' or 'Paid' as enabled According to the condition mentioned in the code written in its 'On Current' Event.

  5. #5
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    @Kundan

    This is off topic but I've noticed over a period of time that your threads are almost all called something like 'Regarding forms' or similar. For example:

    Click image for larger version. 

Name:	Capture.PNG 
Views:	19 
Size:	124.5 KB 
ID:	35073

    This makes it hard to distinguish between the posts and harder still to look back for comments made in previous threads.
    I would have thought it makes things harder for you as well.

    So this is a plea that in future posts you use thread titles that are meaningful, relate to the thread content and if possible unique.
    Many thanks
    Last edited by isladogs; 08-11-2018 at 05:41 AM.
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  6. #6
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,388
    You could also quickly try this
    Code:
    Private sub Form_Load()
        Call Form_Current
    End Sub

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

Similar Threads

  1. Replies: 2
    Last Post: 04-05-2016, 08:29 AM
  2. Replies: 3
    Last Post: 03-23-2016, 12:45 PM
  3. Replies: 2
    Last Post: 11-05-2014, 09:16 AM
  4. Replies: 5
    Last Post: 01-16-2013, 03:48 PM
  5. Replies: 1
    Last Post: 01-04-2011, 05:04 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