The form opens to show a list of all the shaft types which is fine for most things, but sometimes you want to look at just the one. So I thought that the simplest way would be to have a control button on the form to find a specific shaft if you needed to.
So really I just want it to refresh the current form with the query result.
Does that make sense?
This is what I have so far:
For the 'Find Shaft' button
Private Sub find_shaft_button_Click()
On Error GoTo Err_find_shaft_button_Click
What i would do is add a combobox to your form woth the row source being your shaft names
Change the Control source to be a query like
WHERE ((([yourTable].[ShaftName]) Like IIf([Forms]![yourForm]![yourCombo] Is Null,"*",[Forms]![yourForm]![yourCombo])));
now either after you change the combo or click a button we can run the query again
combo changes form
on the combo choose properties and Events and the AfterUpdate Event
put in the code Form.Requery
or after a button is pressed on the button choose properties Events On Click
and in the code put Form.Requery
You will be plase dto know that I have successfully added the combo box and it updates the form beautifully when I flick between design view and testing it out.
But, I don't want other users to change any of the displayed information so I have the form opening in view only mode via a button on my main menu. This is OK but it prevents me from choosing anything from the combo box.
Is there a way of protecting the displayed information, but also being able to choose other records from the combo box.
Go to all your textboxes etc. and in the properties window choose enabled = false
this will stop your users accessing the fields but will display the information for you
but keep the Combobox on true
Give it a try and see if this is what you are after
It works but all the boxes are now a horrible grey and you can't make them white again.
Can I perhaps lock the table rather than the form? Would that work in displaying the information but not being able to change it?