How to Enable/Disable a textfield on endless forms?

N

Niels

Hello Forum,
i am using Access 97 and my "endless form" shows some
records of a query and include a textfield for changing
data.
Now, i like to disable the textfield at some records to
avoid user input to this records.

Is it possible to enable / disable the textfield for a
seperate record? How?
Thanks in advance for any help.
Niels
 
A

Andy Cole

Niels

Use the Form's OnCurrent event to enable/disable your control;

If somecondition Then
Me.txtBoxName.Enabled = False
Else
Me.txtBoxName.Enabled = True
End If

HTH

Andy
 
N

Niels

Hi Andy,
thanks for your hint. I have test it before, but it
does'nt work. If i set enable into the onCurrent Event
*ALL* records as displayed in the same way. All enabled or
all disabled.

Any other ideas?
Niels
 
S

Stephen Lebans

You can enable/disable via Conditional Formatting.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
A

Andy Cole

Niels

Sorry, I misread your post and now realise you're talking about continuous
forms. What you want is not possible as continuous forms are using multiple
instances of the same control. One possible solution is to set the textbox
to Locked and then apply some conditional formatting. CF isn't available as
standard in A97 but Stephen Lebans has a downloadable demo of doing this in
A97 at;

http://www.lebans.com/formatbycriteria.htm

You may be able to use Stephen's ideas to make the control *look* disabled.
The .Locked property would prevent it being updated. You'd need to have
some code to unlock a particular instance of the control if it was supposed
to be editable (suggest the OnEnter event) and then lock it in the OnExit

HTH

Andy
 
S

Stephen Lebans

Andy I missed the start of this thread where the OP stated they are
using A97. Other than your suggestion I really don't see how to achieve
the UI desired by the OP other than upgrading to A2K or higher to use
CF.
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
A

Andy Cole

Stephen
If *you* can't think of a better solution then one doesn't exist!!

Niels
Stephen's *the* man for this kind of stuff. Try my suggestion - if it
doesn't work then upgrading to A2K or higher is your only choice, sorry.

Andy
 
H

Hugh O'Neill

Andy said:
Stephen
If you can't think of a better solution then one doesn't exist!!

Niels
Stephen's the man for this kind of stuff. Try my suggestion - if it
doesn't work then upgrading to A2K or higher is your only choice,
sorry.

Andy


Ah yes, but while 'upgrading' to A2k may assist with this particular
issue, it has a down side in that lots of problems are likely to raise
their heads quite unrelated to this feature.

Weigh up very carefully whether or not what you want here is really,
REALLY essential. If so, then make absolutely sure that you have all
the service packs installed for A2k before you do any design work and,
even then, that you study very carefully the differences and realise
that you probably won't be able to use the Help system as you are use
to doing, if at all!

Hugh
 
N

Niels

Hello Stehen, Hello Andy,
thanks a lot for your comments.
Sorry, I stay offline for some days
and can't replay to your postes.

Well we have to change to A2K ...
but now i have to try programming with A97 at the moment.
Usually i create front-ends for databases by delphi. Now I
was surprised what kind of problems i get by using Access.

Once more. THANKS for reading and helping.


Greatings
Niels
 

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

Top