Solved

When I clear a check box, my code still works, how do I fix this in acccess?

Posted on 2013-01-16
2
232 Views
Last Modified: 2013-01-17
Here is my simple code for a check box:

Private Sub Check165_Click()
'DoCmd.OpenForm "frmExceptions", , , [ResourceID] = "& Me.ResourceID"

DoCmd.OpenForm "frmExceptions", acNormal, , , acFormAdd, acWindowNormal
[Forms]![frmExceptions]![ResourceID] = [Forms]![frmEditResources]![ResourceID]

End Sub

I want to be able to uncheck a box also in order to remove the "exception", and not have the form open.  What is the best way to accomplish this?
0
Comment
Question by:gracie1972
2 Comments
 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 38784973
Try this:


Private Sub Check165_Click()

If Me.Check165 = false then Exit Sub

'DoCmd.OpenForm "frmExceptions", , , [ResourceID] = "& Me.ResourceID"

DoCmd.OpenForm "frmExceptions", acNormal, , , acFormAdd, acWindowNormal
[Forms]![frmExceptions]![ResourceID] = [Forms]![frmEditResources]![ResourceID]

End Sub

Open in new window

0
 

Author Comment

by:gracie1972
ID: 38787974
Thank you, I was so close when I was trying different codes :-)
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

Suggested Solutions

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now