View Full Version : Combo-box and protecting data


Martine
09-12-2000, 10:39 AM
I have a table of societies and a table of the members from the societies.
I have a form in which the user can create, see or modify one member of a society.
In the head of my form i put some informations over the society (name, adress..)
To make his research easier in all cases (create, modify or just consulting) i made a combo box for the name of the society (the other informations of the society are proteted).

I works well, but my problem is that I do not want the user to be able to change the society for an existing member.
How can I avoid this ?

Richie
09-12-2000, 12:23 PM
Make the form read only?

jaxbuilder
09-13-2000, 08:14 AM
How about locking the control if its contents are not NULL?

Use the GOT_FOCUS event of the control.

If IsNull(Me![txtSociety]) Then
With Me![txtSociety]
.Locked = False
Else
.Locked = True
End With
End If

Martine
09-13-2000, 09:02 AM
thank you for the answer, it works well.
The only thing is that i loose the possibility to search another society with the combo box when it is not a creation of a new member but it is better than the risk to have a society changed.

jaxbuilder
09-14-2000, 03:24 AM
I had a similar situation. I put a "find button" to the right of my bound combo box. This button was actually an unbound combo box which I sized horizontally to just the size of the button. I use this combo box to position the form to the selected record when the user clicks on a record from the dropped down list. (I used the wizard "find a record on my form based on the value I selected in my combo box".)
I use these liberally on forms for positioning to a different record -- with each "find button" displaying a list sorted by the field with which it is associated.

[This message has been edited by jaxbuilder (edited 09-14-2000).]