Selections in continous form problem, part II

Niniel

Registered User.
Local time
Today, 17:07
Joined
Sep 28, 2006
Messages
191
Hello,

I have a continuous subform that shows records from a table [not the table the parent form is based on] - a check box, a text field with text, and a blank text field for notes.

When I click on one particular of the checkboxes I see in form view, I can make the notes field/s visible. Unfortunately, that means right now that the fields for all the records become visible.
If at all possible, I would like to set this up so that only one particular text box becomes visible.

Could somebody please tell me if this can be done, and help me do it?

Thanks a lot.
 
you can do something like that in vba; just make sure to have all fields defaulted at enabled = no, which you can do simply in the properties.

The VBA code to re-enable the box
If chkbox.value = true then
textbox.enabled = True
textbox1.enabled = True
Else
textbox.enabled = False
textbox.enabled = False
End If
 
With continuous forms if one is visible, the others are visible. You may need to go to a datasheet view.
 
Ok, thanks.

I'll be playing around with the datasheet view a bit, but unless I can find a way to get rid of the column headers and the record selector, I can't use it.
 
To get rid of the column headers go into form design mode and replace the captions on the labels for the fields to just a space.

To get rid of the record selector (and navigation buttons) go into design mode for the form and set record selectors to NO and Navigation Buttons to NO. You can get the properties for those by selecting the subform by clicking on the square on the top left of the subform so that it puts a black square in the gray square.
 
I'll take another look at the datasheet view, if only to save space on the form, but here's the solution to my problem.
May not be awfully efficient, but at least it's working:

On my parent form:
Private Sub NoteText1_AfterUpdate()

'Copy text from text field to table and save record

DoCmd.RunSQL "Update tblActivityAnswers Set [Note] = Forms!frmBrowseApplications.[NoteText1] WHERE [ActivityID] = Forms!frmBrowseApplications.[ActivityID] And [QuestionID] = 12"
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

End Sub

On my subform

Private Sub Answer_AfterUpdate()

If Me.Answer = -1 And Me.QuestionID = 12 Then
Me.Parent.NoteText1.Visible = True
End If

If Me.Answer = 0 And Me.QuestionID = 12 Then
Me.Parent.NoteText1.Visible = False
End If

End Sub


Private Sub Form_current()

If DLookup("[Answer]", "tblActivityAnswers", "[ActivityID] = " & Me.Parent.[ActivityID] & " AND [QuestionID] = 12") = True Then
Me.Parent.NoteText1.Visible = True
Me.Parent.NoteText1 = DLookup("[Note]", "tblActivityAnswers", "[ActivityID] = " & Me.Parent.[ActivityID] & " AND [QuestionID] = 12")
Else: Me.Parent.NoteText1.Visible = False
End If

End Sub
 
yes it can be done - I've done it by accident - so no idea how I did it
 

Users who are viewing this thread

Back
Top Bottom