Results 1 to 10 of 10
  1. #1
    brandonze is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Mar 2011
    Posts
    49

    Automaticaly checking a check box

    Don't know if I am in the right forum, but here it goes.

    I have an unbound text box that gets populated via barcode scanner. After it is populated, a macro pulls up the record and the rest of the form is populated.

    This system is used for registration of atendees at conferances and depends on the clerk that is scanning the ID to check a check box to show the that the atendee is present. my clerks have been forgetting to check the box, therefore giving me incorrect data.

    is there anyway that I can make the textbox automaticlly check the present box when an ID is scanned?

    I was thinking of an expression in the text box "on change" like

    [present] = Yes.

    but it is not working.

    Any help would be loads better then where im at now.
    Thanks

  2. #2
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    My question is why would you need the checkbox checked if the barcode scanner populates a control? Wouldn't you be storing that and that would indicate they are here?

    But regardless, if you must do the checkbox then in the After Update event of the unbound scanner text box you should be able to use

    Me.present = (Len([Me.YourUnboundTextBoxNameHere & vbNullString) > 0)

    So that will set it to true if there is anything in the text box but if anything is not, it will uncheck it.

  3. #3
    brandonze is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Mar 2011
    Posts
    49
    Thank you much for your reply. I tried the code that you gave me and ran into a problem. It is not checking the box. The code as entered is

    Me.present = (Len([Me.txtDesiredCode & vbNullString]) > 0)

    I might have screwed something up.

    As for why we have this, I create a Table for each conferance that we put on. I build the data from sign in forms and input it in the table. The only thing that the scan of the ID card does is pull up the record on a form. In order to know if the person attended the conferance, I am deppending on the individual registering the client to put a check in the box, of which many forget and I have faulty numbers. By doing this I would ensure that everybody that scans in is accounted for on the attendance roster. Less human error.

    I am open for suggestions if you see a better way.

    Thanks

  4. #4
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    So the scanner doesn't actually put anything into a text box? I would think that it should and if it did, you wouldn't even need the checkbox because the text box with the scanned ID would not be empty and if it isn't empty then the person is here.

  5. #5
    brandonze is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Mar 2011
    Posts
    49
    Sir, you are correct in saying that the scanner puts something in the box. It reads the Code 39 bar coade and deposits the jibberish in the textbox. out of that I take a mid function to pull what I need out of the bar code. what I pull matches a field that I have in my table already and that is how the filter is applied.

    by using a check box instead of storing the whole barcode in the table, it just a cleaner column then the jibberish that the barcode spits out.

  6. #6
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Quote Originally Posted by brandonze View Post
    by using a check box instead of storing the whole barcode in the table, it just a cleaner column then the jibberish that the barcode spits out.
    But it is unecessary because you can just test to see if there is something in the barcode field. You don't need to display it to know if someone has attended.

  7. #7
    brandonze is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Mar 2011
    Posts
    49
    Regretfully, I am still told that they want a check box. I do see what you are saying, and it would work for me, but what the boss want he gets. is there anyway you can look at the code that I posted four posts ago and tell me where I screwed up?

  8. #8
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    The code you posted as not working should work if the text box that holds the barcode is named txtDesiredCode - change the name in the code to the actual name of the text box which holds the scanned ID and then also the checkbox wouild also need to be named PRESENT and if it isn't change that code to use the correct name of the checkbox control.


    Me.present = (Len([Me.txtDesiredCode & vbNullString]) > 0)

  9. #9
    brandonze is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Mar 2011
    Posts
    49
    all the names are correct. I put the code in the txtDesiredCode UNBOUND Text box. the Present check box is a bound box. would that make the differeance? Also, I am putting it in the after update line. do I need to put the code in the expression builder or use vb?

  10. #10
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Quote Originally Posted by brandonze View Post
    all the names are correct. I put the code in the txtDesiredCode UNBOUND Text box. the Present check box is a bound box. would that make the differeance? Also, I am putting it in the after update line. do I need to put the code in the expression builder or use vb?
    It goes in the VBA window not in the event property.

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

Similar Threads

  1. Automatically checking a box?
    By Delta223 in forum Access
    Replies: 3
    Last Post: 01-10-2011, 10:37 PM
  2. Checking a table for changes
    By Rando in forum Queries
    Replies: 2
    Last Post: 10-07-2010, 09:25 AM
  3. Date error checking
    By oediaz in forum Programming
    Replies: 2
    Last Post: 03-26-2010, 12:08 PM
  4. Checking if files exists
    By geoffishere in forum Access
    Replies: 1
    Last Post: 02-09-2010, 01:32 PM
  5. Checking for Value in Query
    By jgelpi in forum Access
    Replies: 1
    Last Post: 06-24-2009, 04:57 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