Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Unbound check box in microsoft access form

Posted on 2013-12-07
5
Medium Priority
?
2,445 Views
Last Modified: 2013-12-08
I have multi-record access form that has an unbound check box. When I select any of the check boxes they are all marked as selected. I need to somehow identify a certain record so that I can use other field values of the record to create a query tied to a button on the form. Can the unbound check box be used to identify a specific record or is there a better way to identify a record for use as a parameter in a query?
0
Comment
Question by:PetGuy
  • 3
  • 2
5 Comments
 
LVL 58

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 2000 total points
ID: 39703676
This is a common problem.   Your best bet is to add a "Selection table", which has a field for the primary key of your record..

Add this table to the query for your form, join on the primary key, and then double click on the line and make it an outer join.

You can then define a column in the query as:

Not IsNull(<selection key field>)

Then use a transparent command button over the check box to toggle the state of the checkbox by adding/deleting records in the selection table.

  The other method if you only need to select a single record is use the Primary Key field as part of a WHERE clause for a form or report.

Jim.
0
 

Author Comment

by:PetGuy
ID: 39703690
Thanks for the point in the right direction. And fast.
0
 

Author Comment

by:PetGuy
ID: 39703715
How do I do a transparent command button. It is totally new to me.
0
 
LVL 58
ID: 39704227
<<How do I do a transparent command button. It is totally new to me. >>

 Set the Transparent property to Yes.  Then place the control and do a "Bring to Front" on the arrange menu.

This places it "on top" of the check box and it will receive the click rather then the check box.   Besides the normal top/bottom, left/right positioning, there is also a Z order to controls (3rd axis).   The "send to back" and "bring to front" are the two commands that work with this and control what is seen when controls are stacked on top of one another.

Make sure it's big enough that it covers the checkbox.  Also, you should set the enabled property to false and the locked property to true on the checkbox.

Jim.
0
 

Author Comment

by:PetGuy
ID: 39704582
thanks
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses

885 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