Link to home
Get AccessLog in
Avatar of Richard

asked on

access: link textbox to checkbox in query

I attach my dbse “Completion matters”

First, go to the Form
Go to tab called chaps.

On that from there are a number of text boxes and corresponding tick boxes.

When I tick a box the text box turns colour red.

What I want to do is make a query that tells me which of the boxes is not red or
alternively is not ticked against.

At the moment there is no other code connection between thew boxes other than the colour red/ black.

The “ colour” code operates on the update of the check box.

What is the best way to run a query based on what I want to do, which is to tell me which text boxes do not have a tick against them?


Avatar of RgGray3

Your question is a little confusing...

Let me restate it and see if I have it right....

You want to create a query, that identifies which checks are not selected.

Are you looking to return full records for any record that has ANY check not selected

If so...   simply insert FALSE in the criteria section of your query under each of the columns...
To clarify...   if you want any record that does not have ALL of the checks selected
Put a False under each column but on seperate rows in that column

Avatar of Richard


Sorry to be confusing....

I would like ANY record which has an unchecked text box on that form showing up in the query/report
Avatar of Richard


no thats not true apologies...

I want any record iin the query that HAS a black entry (ie has an entry that is unchecked) to show up

BUT NOT any text box entry on that tab which is checked/red
Avatar of Richard


blank text box and no tick doesnt show up

red text and tick shows up.

You can manage the color logic without the code...

Use conditional formatting...

Select the textbox that is associated with a particular checkbox

Select the [to whom sent 1] text control
Select Format from the menu and Conditional formatting from there.

You will get a dialog box that allows you to create different formatting based upon your logic
in this case...  if [Check325] = True    

BTW,  for clarity I would give your check boxes that make it easy to see the relationship between the check and text controls  IE txtWhoSent1 and chkWhoSent1

If you use conditional formatting you no longer require code to manage the "Flag" nature of your color coding

Avatar of Richard


forgive me,

blank text box and no tick doesnt show up

BLACK text and no tick shows up.

RED text and tick is excluded

Go back to my original post...  in your query  (names were changed for simplicity)

Check1    Check2   Check3   Check4

A seperate false for each column on a seperate row in the query builder grid
Avatar of Richard


rationale is that where my cashier sees a BLACK text and NO tick shes knows to enter it inot separate accounts.

When shes entered its tocked and turns red

BUT she wants a list of unticked BLACK items to show whats remainng to be entered

phew.... thanks
Avatar of Richard


cool sounds like i am over complicating it.

Just for my info... i get the false bit but why the separate row and whats happening there...
OK... for clarity...

you need to identify A) If the text Box is Blank...  
                       AND B)there is NO tick


you need to identify A) If the text Box is Blank...  
                         OR B)there is NO tick

If you place the falses on the same line...  they become an AND  instead of an OR


ALL of the 4 fields would need to be false to become part of your result
Avatar of Richard


not sure if its there yet..

because someone else is entering the black entries she needs to filter IN the BLACK entries and filter OUT the blank ones.
Avatar of Richard


thanks for the explanation for the rows.
Avatar of Richard


the reason why she needs to filter out the BLANK ones is that she needs to locate those black entries

would it something like this:

if contents of text box <>0 then checkbox is something so she could pick up the checkboxes.

OK...  we are getting somewhere...  good.

Let's clarify the question...  then the logic will follow..

You need to separate Those where the Check is not selected AND the corresponding field is blank..  correct...?

If so....  now we use field pairs in the criteria. (I'll do this for 2 sets....   the same logic would need to be done for the additional pairs)

  Check1        Text1      Check2       Text2
False         is null or ""
                                     False         is null or ""

Depending on how your table is constructed and validity rules...   I am assuming that the text field can be blank or hold an empty string...  (there is a difference)  and there is no penalty in testing for both

Do the same for Pairs 3 and 4 and you should have it.
If you are looking for those that are Blank and have a checkmark...  simply replace the false with True
Avatar of Richard


I think we are getting there too i need to FIND those text boxes with "something in them"

AND which dont have a check mark ticked.

please forgive my logical flaws.

It would appear from what you say the colour is a red herring (joke)

Avatar of RgGray3

Link to home
This content is only available to members.
To access this content, you must be a member of Experts Exchange.
Get Access
Just double checked...
There is no Control Source for the check marks...   this would need to be stored somewhere to perform logic against it...
Avatar of Richard


thats ok i can fix that just go back to the table and make some new ones

thanks for pointing that out...i'd forgotten

i will award points to you and if i get into any diffculties i will post a re-comment but i can see where im going......


Good luck and let me know if you have additional problems