Continuous form problem

M

mel

Hi, I have a continuous form that lists everyone's education data and
there is a textbox titled "Find..." set up as a hyperlink to allow
users to click on it and bring up a pop-up form. The pop-up allows
users to search a list of institutions by entering Institution Name or
City. When they enter their search criteria, results are displayed
below the search boxes. The Code column is clickable so users can
select their institution, which then automatically adds the institution
and city back to the continuous form. This works well but I would like
to set the particular institution and city fields' "Enabled" property
to "false" after data is added. My problem is that ALL the institution
and city fields "Enabled" property on the continuous form get set to
"false". Is there any way to target the institution and city fields for
a specific record? I have tried entering

Me.Institution.Enabled = False

in the On Current, After Update, On Dirty events in the continuous
form. I tried entering it in the After Update and On Dirty events for
the Institution textbox too but no luck.

Is it possible to do what I described?

Many thanks.
 
S

Svetlana

On current event of your form you could check if institution data is
entered and then turn the button enabled=false or true like

If IsNull(Me.Institution)=False Then
Me.Institution.Enabled = False 'or you could use
Me.Institution.Locked=True
Else
Me.Institution.Enabled = True 'or Me.Institution.Locked=False
End If
 
M

mel

That would work for new records, but users need to be allowed to update
existing records by clicking on the "Find..." button and selecting the
institution code. I just don't want them to be able to edit the text in
existing records since data comes from a preformatted table. Any ideas
how to handle that? Thanks.
 
M

mel

Thank you for your reply. I decided to use the "Locked" property
because it was easier. I just changed the forecolor of the text to gray
to make it look grayed out.

I appreciate the help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Combo box/Forms 1
Vurtual Subform 4
search box 3
VBLOOKUP BY DEPT 3
Create form with xy data entry 2
VLOOKUP 2
Combo box selection opens form 1
Visual Basic Code 3

Top