Display data in a form depending on user

mcalex

Registered User.
Local time
Today, 15:39
Joined
Jun 18, 2009
Messages
141
Hi all, a simple one (I think)

I have a form that I wish to display data on when the user clicks a checkbox. Essentially, on clicking a button in a different form, this form pops up (like a dialog). If the user clicks the 'Show data ...' checkbox (which is the only other thing on the form) I want to display the result of a query.

My question is what item from the toolbox do I use to display the data if I want it to look like a datasheet/grid? Subform/subreport looks closest, but I'm not creating a master/detail form so I don't think SUBforms are conceptually correct. All I want is a grid to show three fields and usually between 5-8 records.

Also, is it best to run the query as the form loads and keep the data hidden, or run the query when the user requests the data be displayed (ie when the checkbox is selected)?

many thanks

mcalex
 
ok, using a subform seems to be working. now to work out how to hide the data before I'm ready for it
 
Use the visible property.. An "if ....then" statement or a "Select Case"...

For an example, this is one for an option group... "Yes or No" to display a textbox for the date if the option is "Yes"

Private Sub Hired_Click()
Select Case Me.Hired
Case Is = -1
Me.HireDate.Visible = True
Case Is = 0
Me.HireDate.Visible = False

End Select
End Sub
 

Users who are viewing this thread

Back
Top Bottom