continuous forms and locking records

C

Chris Strug

Hi,

I gather that this is quite a popular question however I'm completely unable
to find a solution through google. So if anyone can provide a helping hand
it would be greatly appreciated.

I have an Access 2003 ADP which contains a bound continuous form. Everything
(for once) is working just fine except:

Based on the contents of one control in the form I'd like to prevent the
user from editing that record depending on the contents. I.e. if txtStatus =
"Cancelled" then prevent changes to that record.

Now I understand that by using continuous forms all I should have to do is
to test the value of the txtStatus control in the current event and enable /
disable the "allowedits" property of the form as the current event will run
for every record that gets the focus.

However it won't let me get that far. Everytime I reference a control in the
continuous form in the Current event of the form, the event runs but I get
the error message:

"Run-time error '2424':

The expression you entered has a field, control, or property name that <app
name> can't find."

I'm at a loss. Cany anyone explain what the application is doing and how I
can change it so that it will let me examine the status of the current
record and react accordingly...

Thanks

Chris.
 
B

Baz

Chris Strug said:
Hi,

I gather that this is quite a popular question however I'm completely unable
to find a solution through google. So if anyone can provide a helping hand
it would be greatly appreciated.

I have an Access 2003 ADP which contains a bound continuous form. Everything
(for once) is working just fine except:

Based on the contents of one control in the form I'd like to prevent the
user from editing that record depending on the contents. I.e. if txtStatus =
"Cancelled" then prevent changes to that record.

Now I understand that by using continuous forms all I should have to do is
to test the value of the txtStatus control in the current event and enable /
disable the "allowedits" property of the form as the current event will run
for every record that gets the focus.

However it won't let me get that far. Everytime I reference a control in the
continuous form in the Current event of the form, the event runs but I get
the error message:

"Run-time error '2424':

The expression you entered has a field, control, or property name that <app
name> can't find."

I'm at a loss. Cany anyone explain what the application is doing and how I
can change it so that it will let me examine the status of the current
record and react accordingly...

Thanks

Chris.

It would help if you posted your code and identified the line where the
error occurs.
 
D

Daniel Feeney

Hi people,

I just thought I would post to help out other people like myself who have
been looking for a solution to this same problem. As others have mentioned
it is likely to be a mispelled or non-existent control, however in my case
it was actually the 'Control Source' of the text box that was invalid,
producing the same error. I added the missing field to the forms 'Record
Source' and problem solved.

Dan
 

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