bound checkboxes in subforms

Abbyisstuck

New member
Local time
Today, 21:56
Joined
Sep 30, 2004
Messages
6
I'm relatively new to Access and am self-taught so please excuse me if this sounds elementary...
I'm trying to put a yes/no checkbox in a subform displaying event registration details on a form with attendee details. I've added a column to the registration subform's table to store the data, and after opening the registration form in design view I clicked the checkbox tool on the toolbar and then dragged the appropriate field from the field list to the form. The problem is, when I open the properties of the checkbox it is not linked to any data (ie. it appears to be un-bound)

The second issue is this: When the registration form is in form view I can check or uncheck the box, but when I close this window and look at it as a read-only subform in the attendee details form it's grey-d out so that it's neither checked nor unchecked.

I've exhausted the office assistant (well that didn't take long!) and need help please!
 
You should be able to bind the field from the property sheet by just selecting the field you want from the dropdown in the "Control source" field.

Peter
 
I should have mentioned...

Thanks for the suggestion - unfortunately I neglected to mention that the data tab in the properties box is blank - so there is no drop down field list.... any ideas? :(
 
Abbyisstuck said:
Thanks for the suggestion - unfortunately I neglected to mention that the data tab in the properties box is blank - so there is no drop down field list.... any ideas? :(

Hundreds of em' which one ya want?

The first thing you need to do is to base your form on a table or query.
 
Abbyisstuck said:
I've added a column to the registration subform's table to store the data...

There is already a table and it includes a column with a fixed value of Yes or No where the checkbox data can be stored. How do I link this to the form when the data tab in the properties box for said checkbox is blank?
 
Abbyisstuck said:
There is already a table and it includes a column with a fixed value of Yes or No where the checkbox data can be stored. How do I link this to the form when the data tab in the properties box for said checkbox is blank?

Is the data type in the table design a yes/no data type?
 
Abbyisstuck said:
The second issue is this: When the registration form is in form view I can check or uncheck the box, but when I close this window and look at it as a read-only subform in the attendee details form it's grey-d out so that it's neither checked nor unchecked.

Test it out with more then one record, each opposite values
 
At the risk of stating the obvious :p make sure that you are selecting the check box and not its associated label

Peter
 
It's always worth stating the obvious! Ok I was probably looking at the label properties before, but now looking at the control properties is says it is linked to the table - but the checkbox still doesn't display whether it's checked or unchecked when viewing it in the read-only subform - I checked both possibilities in for several different attendee records.

So far as I can tell what I'm trying to do should be very straightforward - all I can assume is that my lack of experience means I'm making some sort of stupid error because I can't see why this should be so difficult!

By the way thanks for your help and suggestions so far - I appreciate it!
 
Post your data base and I'll look at it tomorrow.

By the way, when you talk about "read only" is the form set read only via visual basic, macro, or form properties?

If it is set via visual basic or a macro these could be setting within the code like(where "checkbox" is the name of your checkbox control):

For visual basic
checkbox.enabled = False

or

There would be a line with setvalue as action and when you have the line selected, down the bottom (for macro):

Item: [checkbox].[enabled]
Expression: No

Does this help? Please respond

Scott
 
I'm starting to think I'm a hopeless case!

I didn't knowlingly set the subform's display in it's parent form (I know it's not the right lingo but I hope it makes sense) to read-only - I think I created it via a wizard - I basically have an events management database template that I have made alterations to according to my purpose.

The code for the form I'm having trouble with is this:

Option Compare Database


Private Sub ViewEvent()
On Error GoTo Err_ViewEvent
DoCmd.OpenForm "Registration"

Exit_ViewEvent:
Exit Sub

Err_ViewEvent:
MsgBox Err.Description
Resume Exit_ViewEvent
End Sub
Private Sub EventName_DblClick(Cancel As Integer)
ViewEvent
End Sub
Private Sub StartDate_DblClick(Cancel As Integer)
ViewEvent
End Sub
Private Sub Sale_Amount_DblClick(Cancel As Integer)
ViewEvent
End Sub
Private Sub Total_Payments_DblClick(Cancel As Integer)
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.OpenForm "Payments"
End Sub
Private Sub Amount_Due_DblClick(Cancel As Integer)
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.OpenForm "Payments"
End Sub


I couldn't see anything indicating the checkbox in question was not enabled - but if I'm honest I don't really know what it all means. My VBA experience is very limited - usually cutting and pasting rather than writing. I'm not even sure if this code explains the display of the information of the subform (shown as a simple 3 column table within the parent form), or if there is simply some sort of link to the VBA code for the subform itself.

The properties for the checkbox in question in the VB editor window says that it is enabled and it's not locked - but I think this refers to the button in the subform itself, which works fine, while the problem lies in the display of whether or not the box is checked in the table display of the subform's data in the parent form.

I hope this makes sense and I'm not wasting your time.

thanks again for your help.
 
Abbyisstuck said:
I'm starting to think I'm a hopeless case!

The reason you may think you are a hopeless case is because Microsoft loves to be very complicated, using technical jargon which daunts users when they go out of their comfort zone (Help documentation).

The wizards that is combined with access writes very complex code, which some have said is like using a rusty bucket.

The way I have learned to use Visual basic is to first learn to use macros, then save the macros as a module and from there copy and paste the contents. pretty soon you will learn visual basic.

Now I hardly use macros if I can do it in vb.

As I said before, if you can't post your database, we can't help you.

Scott
 

Users who are viewing this thread

Back
Top Bottom