The application in question has a number of forms.
One of these forms has a subform that lists a series of recommendations as the results of a query.
Now, in the case that the id of the recommendation is 10 or 13, then a set of text boxes are required, so that data can be recorded against this item in the table.
I have created the textboxes on the sub form, and set visibility to false.
I have a simple piece of code (below) to switch the visibility on, but it wont work. I suspect it is because I have the code placed in the wrong event.
So, What is the right event to use, so that when the data is queried from the database, if a record is pulled back with an ID of 13 then the text boxes visible property is set to true?
And as a sub question / design question, currently I have the recId being pulled into a textbox. Is this the best way (being as its the key) or can I just refer to it in the datasource without sticking it into a control?
K
One of these forms has a subform that lists a series of recommendations as the results of a query.
Now, in the case that the id of the recommendation is 10 or 13, then a set of text boxes are required, so that data can be recorded against this item in the table.
I have created the textboxes on the sub form, and set visibility to false.
I have a simple piece of code (below) to switch the visibility on, but it wont work. I suspect it is because I have the code placed in the wrong event.
So, What is the right event to use, so that when the data is queried from the database, if a record is pulled back with an ID of 13 then the text boxes visible property is set to true?
Code:
Private Sub Form_Query()
If (tbRecId.Text = "10") Or (tbRecId.Text = "13") Then
tbWarrantyCost1.Visible = True
tbWarrantyCost2.Visible = True
tbWarrantyCost3.Visible = True
tbWarrantyMonth1.Visible = True
tbWarrantyMonth2.Visible = True
tbWarrantyMonth3.Visible = True
End If
End Sub
And as a sub question / design question, currently I have the recId being pulled into a textbox. Is this the best way (being as its the key) or can I just refer to it in the datasource without sticking it into a control?
K