Automatically filling a check box via a macro

DJ P
DJ P used Ask the Experts™
on
I have a simple macro (see below) for an access 2013 database that has you can see prompts for a message box to inform the user to select a check box (called "complete trans"). The problem is a good portion of our folks forget to check the box (go figure). What I would like to do is have the box automatically checked once they select ok on the message box. What is the line of code to accomplish this? Below is my macro.

Option Compare Database

'------------------------------------------------------------
' Macro1
'
'------------------------------------------------------------
Function Macro1()
On Error GoTo Macro1_Err

    DoCmd.RefreshRecord
    DoCmd.OpenQuery "Append History Database", acViewNormal, acEdit
    DoCmd.RefreshRecord
    Beep
    MsgBox "UNCHECK THE ""COMPLETE TRANSACTION"" BOX BEFORE PROCEEDING.", vbCritical, "SE-SELECT CURRENT RECORD"

Macro1_Exit:
    Exit Function

Macro1_Err:
    MsgBox Error$
    Resume Macro1_Exit

End Function
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2015
Distinguished Expert 2018
Commented:
That will be:

Me![complete trans].Value = True

Open in new window

or, if you prefer:

Me!("complete trans").Value = True

Open in new window

However, do avoid spaces in control names. Then it would be:

Me!CompleteTrans.Value = True

Open in new window

Rob HensonFinance Analyst

Commented:
If you are auto ticking the box then it might as well not be there.  Just have a confirmation with OK button.

Author

Commented:
Gustav, so I would place your suggestion below the msgbox line of code correct?
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Most Valuable Expert 2015
Distinguished Expert 2018

Commented:
Yes.

Author

Commented:
Awesome. Thanks so much.
Most Valuable Expert 2015
Distinguished Expert 2018

Commented:
Great. Then please mark as answered.
Have a nice weekend!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial