Results 1 to 11 of 11
  1. #1
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664

    Where does this variable get its value?

    In the file attached where does the chk_ticket_assigned in the Sub Form_Current get its value initially?



    By debugging I learned that it value is 0. But I cannot see where it get its value.

    Any help appreciated. Thanks in advance.

    Respectfully,

    Lou Reed
    Attached Files Attached Files

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    You mean here?

    If Me.chkTicketAssigned = True Then

    That's a checkbox on the form, not a variable. That's where the value comes from (more accurately from the field in the table the checkbox is bound to, ysnTicketAssigned).
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664

    The PIC with the form's code is attached

    I have attached a screenshot of the form's source code. It shows in the Sub Form_Current()

    where the code is that I have a problem with. Again where does the VBA program get it value?


    Respectfully.


    Lou Reed
    Attached Files Attached Files

  4. #4
    jwhite is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Dec 2012
    Location
    North Carolina
    Posts
    349
    Paul clearly advised the answer for you. Maybe this image will help?Click image for larger version. 

Name:	ysnTickedAssigned.png 
Views:	16 
Size:	80.2 KB 
ID:	28355

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    Again, from the check box on the form.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664

    Let me exlpain the situation

    Let me explain my situation. In the attached MS Access 2010 db, the value on the frmEmail is determined by the value in the query qryPersonnelMeeting and that value is determined by
    what is on the table tblAttendence.

    Now I have included two PICs of screen shots of the table tblAttendence and form frmEmail.

    In this one the check box on the form frmEmail is checked or unchecked which determined by the table tblAttendence via the query qryPersonnelMeeting.

    Now loading the db that I have attached and checking the table tblAttendence to see if the first entry has a check in the box Meeting_invite_sent, I noticed that this has no bearing on what is in the check box on the form frmEmail. They simply operate independently. They are not linked as they are supposed to be.

    No matter what you do in the first entry in table tblAttendence, the check box on form frmEmail is unchanged.

    That should not be the case. I guess it could be changed by using the requery command, but I have an earlier database that is quite similar (some names of variables are changed from st to str and that is it). and tblAttendence and frmEmail seem to work together.

    I have not attached the db where table and form where they work together, but I can if it is needed.

    I just cannot understand what is going on.

    Any help appreciated. Thanks in advance.

    Respectfully,


    Lou Reed
    Attached Files Attached Files

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    Tables and unsorted queries can be thought of as buckets of data. They may or may not be in any particular order. If you want the query/form to be in a particular order, apply it in the query. In other words, the form is not opening to the first record in the table, so it will not reflect that record's data. If you add attendance ID to the form, you'll see it's opening to record 132 (at least for me, but as I said it's meaningless with applying a sort.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664

    Try this db it does what it is supposed to do

    I am not sure that I follow you. I have uploaded a zip file of a similar program, with one exception: the boxes on tblattendencee and frmEmail do exactly what I want them to do.

    They coordinate perfectly. If i check or uncheck the box in tblAttendence, then it is immediately reflected in frmEmail. Try it, and you will see.

    Now why does this one work and the other one I attached from yesterday's post does not work?

    I like that this one works, but I cannot guarantee it.

    This is fine the one I attached to a post yesterday is not working, why?

    There must be a solution to this.

    I cannot go with a db that works sometimes - maybe.


    Respectfully,

    Lou Reed

    PS FYI This db came from my home MS Office 20116. Thus it is MS Access 2016. That should not matter.
    The one at work is from MS Access 2010.
    Attached Files Attached Files

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    I'm saying you can't count on the order unless you specify it. It might be the same order as the table, it might not. If the order is important to you, specify it in the query.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  10. #10
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    Okay, I will try. Tank you very much.

    Respectfully,

    Lou Reed

  11. #11
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    No problem.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 3
    Last Post: 05-28-2013, 12:53 PM
  2. Object variable or With block variable not defined
    By PorscheMan in forum Programming
    Replies: 3
    Last Post: 01-16-2013, 01:53 PM
  3. Replies: 0
    Last Post: 08-10-2011, 11:59 AM
  4. Replies: 4
    Last Post: 08-05-2010, 01:26 PM
  5. Refering to variable form names inside a variable
    By redpetfran in forum Programming
    Replies: 2
    Last Post: 05-21-2010, 01:39 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