Results 1 to 9 of 9

Using macro for check box

  1. #1
    Hossein's Avatar
    Hossein is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Oct 2018
    Posts
    11

    Using macro for check box

    Hello

    I am trying to run a massage box by using check box and macro. when check box is true by click on a bottom the massage box show "OK" Massage.
    I try for this mater but i have error. also i wanna say that using macro is my goal and i don't want using visual basic environment or typing any code. please help me ?




    Also i am looking for a source or any books for using macro in ms access. i don't want work by visual basic environment or learning complicated things for VBA programing, i thinks that just working by macro is enough for me

    Many thanks in advance for your kind support

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    45,138
    You want 'message' box, not 'massage'.

    What is the exact error message?

    Not much of a message statement, just the letter "A".
    To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression. Attachment Manager is below Advanced editor window, click Go Advanced below Quick Reply window.

  3. #3
    Hossein's Avatar
    Hossein is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Oct 2018
    Posts
    11
    Quote Originally Posted by June7 View Post
    You want 'message' box, not 'massage'.

    What is the exact error message?

    Not much of a message statement, just the letter "A".
    Many thanks for your attention

    I uploaded a video from my error as below link


  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    45,138
    There is no link and no video, just a big black box in your post.
    To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression. Attachment Manager is below Advanced editor window, click Go Advanced below Quick Reply window.

  5. #5
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    4,406
    Video there for me but too small. Copied the url then opened in full screen on YouTube. Still hard to see (fuzzy) but I think you could have avoided the video if you posted the error message. Going forward, always provide the error message and number if you know that as well.

    I think your problem is that you don't have the full reference to the checkbox and Access doesn't know where Check545 is. You're using an embedded macro (most of us here avoid macros entirely) and when editing it, you need to use the expression builder to construct the full reference to the check box. It would be something like Forms!frmNameOfForm.Check545.

    For everyone's benefit, the partial error statement is "the object doesn't contain the automation object..."

    I'm not 100% sure if that's the reason for the error, but it certainly seems so.
    - "doesn't work" is no help. Post err msgs and where.
    - Use code tags for code/sql. Implement changes in copies of your database.
    So, like, why do you, like, start a sentence with, like, "so"?

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    45,138
    Works for me without full form prefix for control reference. Something else is issue.
    To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression. Attachment Manager is below Advanced editor window, click Go Advanced below Quick Reply window.

  7. #7
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    4,406
    Found out I could see video much better if I switched to 1080p and increased magnification. I can't replicate the issue either.
    Maybe the form is corrupt. Suggest you create a new test form and test with only 2 new controls. If the issue persists, then maybe it's a Trusted Locations issue or corruption. If it's not a TL issue then I'd try compact/repair on the db if the 2nd form doesn't work either. If the 2nd form does work, the 1st form may be corrupt, in which case, create a new one and try copying all the controls to the new on and see how it performs.

    If none of these (or any other suggestions you get) don't work, more info about the form would be good, such as, is it a split form? Are there other embedded macros on it that DO work?
    You could always consider posting a compacted AND zipped copy of your db, even if it only contains this one form (and any table/query it needs so that there are no opening errors).

  8. #8
    Hossein's Avatar
    Hossein is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Oct 2018
    Posts
    11
    Quote Originally Posted by Micron View Post
    Video there for me but too small. Copied the url then opened in full screen on YouTube. Still hard to see (fuzzy) but I think you could have avoided the video if you posted the error message. Going forward, always provide the error message and number if you know that as well.

    I think your problem is that you don't have the full reference to the checkbox and Access doesn't know where Check545 is. You're using an embedded macro (most of us here avoid macros entirely) and when editing it, you need to use the expression builder to construct the full reference to the check box. It would be something like Forms!frmNameOfForm.Check545.

    For everyone's benefit, the partial error statement is "the object doesn't contain the automation object..."

    I'm not 100% sure if that's the reason for the error, but it certainly seems so.
    My Guys, thank you very much for your support. my problem is solved by using your below guide.
    you need to use the expression builder to construct the full reference to the check box. It would be something like Forms!frmNameOfForm.Check545.
    Click image for larger version. 

Name:	OK.jpg 
Views:	9 
Size:	46.2 KB 
ID:	35753

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    45,138
    Interesting, because I did not need full reference. However, command button and checkbox are both on same form. That must not be the case for your situation. Glad you got it working.
    To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression. Attachment Manager is below Advanced editor window, click Go Advanced below Quick Reply window.

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

Similar Threads

  1. Replies: 41
    Last Post: 12-06-2016, 07:40 AM
  2. Macro and check box
    By UT227 in forum Macros
    Replies: 6
    Last Post: 11-17-2016, 08:00 AM
  3. How to check if email was sent when macro run.
    By behnam in forum Programming
    Replies: 2
    Last Post: 07-18-2014, 04:48 AM
  4. Replies: 8
    Last Post: 05-25-2012, 10:42 AM
  5. Noob Question macro to check checkbox
    By bradmitchell in forum Access
    Replies: 1
    Last Post: 05-13-2012, 09:08 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
  •  
Tech Forums: Microsoft Office Forums