Solved Checkbox question (1 Viewer)

ProgramRasta

Member
Local time
Today, 00:15
Joined
Feb 27, 2020
Messages
98
Hi All,

I have what is hopefully a very quick question.

I have a form where the detail section is populated based on a query. There are two fields that can have variable number of records returned. I was wondering would it be possible to add a checkbox for each record that is returned without assigning a checkbox to a table?

this form will be opened based on a checkbox from another form. What I want to do is, if the person opens this form, they can tick a checkbox and it will return the value to the main form.

hopefully I’m making sense!

many thanks
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 17:15
Joined
Oct 29, 2018
Messages
21,358
Hi. Sorry, it didn't make sense to me. Can you, maybe, illustrate what you mean by using some mockup data? Thanks.
 

moke123

AWF VIP
Local time
Yesterday, 20:15
Joined
Jan 11, 2013
Messages
3,852
I am also a little confused but I wonder if a listbox may be a better choice.
 

ProgramRasta

Member
Local time
Today, 00:15
Joined
Feb 27, 2020
Messages
98
Hi. Sorry, it didn't make sense to me. Can you, maybe, illustrate what you mean by using some mockup data? Thanks.

Hi DBGuy,

thanks for taking the time to reply. this is a very rough sample!

In Form1 - I want the detail section to be populated based on query1 - I want a checkbox populated for each record returned in query1.

The goal is, if someone clicks on the checkbox on a specific record, this will populate that record on a different form.

I appreciate your help.
 

Attachments

  • DBSample.accdb
    476 KB · Views: 135

MajP

You've got your good things, and you've got mine.
Local time
Yesterday, 20:15
Joined
May 21, 2018
Messages
8,463
Wow, that really makes no sense to me. I have no idea what you are talking about. You need to really explain this. Take your time explaining, because that example is useless.
 

moke123

AWF VIP
Local time
Yesterday, 20:15
Joined
Jan 11, 2013
Messages
3,852
Still a little confused.

An unbound checkbox will carry its value from record to record. So all records in the forms recordset will include the same value.

Might be better if you describe in real terms what you want to do.
 

Isaac

Lifelong Learner
Local time
Yesterday, 17:15
Joined
Mar 14, 2017
Messages
8,738
Might consider using a button instead. That way if they click on the button next to a given record, you can write code to take the values from that record and put them somewhere.
 

ProgramRasta

Member
Local time
Today, 00:15
Joined
Feb 27, 2020
Messages
98
Apologies, the sample was rushed and obviously didn't do the job.

I figured out the issue.

thanks for replying.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 17:15
Joined
Oct 29, 2018
Messages
21,358
Apologies, the sample was rushed and obviously didn't do the job.

I figured out the issue.

thanks for replying.
No worries. Glad to hear you got it sorted out. Cheers!
 

ProgramRasta

Member
Local time
Today, 00:15
Joined
Feb 27, 2020
Messages
98
Hi All,

Apologies for the rushed database yesterday.

I've made some small amendments to the database which hopefully makes my question clearer.

In Form1 (that is populated from Query1) you will see checkboxes populated.

If I click any checkbox, it clicks all checkboxes, my question which obviously wasn't clear yesterday is, is there any way I can click just one of the checkboxes and it will return the record (from query 1) where the row is the same? If it's not possible please let me know and hopefully provide a better alternative.

Many Thanks
 

Attachments

  • DBSample.accdb
    480 KB · Views: 113

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 08:15
Joined
May 7, 2009
Messages
19,169
there is Only 1 checkbox, so clicking 1 will check all.

there are 2 unbound textbox i added, txtList and txtAdd.
plus 1 command button on top of txtAdd, It has transparent background.
see the code behind the Click event of this button.
there is also a Conditional Format on txtAdd textbox.
 

Attachments

  • DBSample.zip
    35.5 KB · Views: 106

ProgramRasta

Member
Local time
Today, 00:15
Joined
Feb 27, 2020
Messages
98
there is Only 1 checkbox, so clicking 1 will check all.

there are 2 unbound textbox i added, txtList and txtAdd.
plus 1 command button on top of txtAdd, It has transparent background.
see the code behind the Click event of this button.
there is also a Conditional Format on txtAdd textbox.
Many thanks for your time. Have a great weekend.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 08:15
Joined
May 7, 2009
Messages
19,169
some minor fix.
 

Attachments

  • DBSample.zip
    28.1 KB · Views: 144

bob fitz

AWF VIP
Local time
Today, 00:15
Joined
May 23, 2011
Messages
4,717
Rather than using checkboxes, try using a listbox on a form as moke123 suggested in an earlier post. See attached.
 

Attachments

  • DBSampleBob01.accdb
    480 KB · Views: 129

ProgramRasta

Member
Local time
Today, 00:15
Joined
Feb 27, 2020
Messages
98
some minor fix.
Thanks again, there seems to be a minor bug whereby if I click ID15, it will also highlight ID5, ID14 will highlight ID4 etc.

If I wanted to populate the ID field based to a different Form based on the click event - will I reference the txtlist textbox?

I am clearly not too advanced in Access!
 

ProgramRasta

Member
Local time
Today, 00:15
Joined
Feb 27, 2020
Messages
98
Rather than using checkboxes, try using a listbox on a form as moke123 suggested in an earlier post. See attached.

Thanks for the reply - is there a way to populate another form from a list box based on which record is clicked?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 08:15
Joined
May 7, 2009
Messages
19,169
sorry about that.
 

Attachments

  • DBSample.zip
    73.6 KB · Views: 140

moke123

AWF VIP
Local time
Yesterday, 20:15
Joined
Jan 11, 2013
Messages
3,852
Thanks for the reply - is there a way to populate another form from a list box based on which record is clicked?
Again a better explanation of exactly what you want to do would help to get more focused answers. Do you want to limit the selection to one record or multiple records? If one record the code is simple, if multiple its still easy but more complex.

example:
 

Attachments

  • rev_DBSample.accdb
    440 KB · Views: 83
Last edited:

ProgramRasta

Member
Local time
Today, 00:15
Joined
Feb 27, 2020
Messages
98
Thanks all for the various solutions - the Listbox examples were very useful.
 

Users who are viewing this thread

Top Bottom