Toggle DataEntry Programatically

A

andrew3254

Hiya,

I have several forms which I want to toggle the DataEntry property according
to a user property. The user property is being looked up and the right value
is being obtained but when it comes to setting the DataEntry property of the
form it doesnt seem to be working.

Here is my code:

If isAdmin = True Then
[Forms]![frmSecondments].Form.DataEntry = False
[Forms]![frmSecondments].NavigationButtons = True
Else
[Forms]![frmSecondments].Form.DataEntry = True
[Forms]![frmSecondments].NavigationButtons = False
End If

The navigation buttons are switching ok but the data entry isnt.

Does anyone have any ideas?
 
D

Dirk Goldgar

andrew3254 said:
Hiya,

I have several forms which I want to toggle the DataEntry property
according
to a user property. The user property is being looked up and the right
value
is being obtained but when it comes to setting the DataEntry property of
the
form it doesnt seem to be working.

Here is my code:

If isAdmin = True Then
[Forms]![frmSecondments].Form.DataEntry = False
[Forms]![frmSecondments].NavigationButtons = True
Else
[Forms]![frmSecondments].Form.DataEntry = True
[Forms]![frmSecondments].NavigationButtons = False
End If

The navigation buttons are switching ok but the data entry isnt.

Does anyone have any ideas?


It seems to me that it should work, and does in my simple test -- though you
don't need the ".Form" qualifier, nor the brackets (in this case). What
does "not working" mean in this case? I gather you don't gt an error
message, but what exactly do you see that you don't expect to see, or not
see that you expect?
 
A

andrew3254

The form defaults to the DataEntry property set in the form design whether
isAdmin is True or False. It doesn't seem to change the property. I am not
getting an error message. I think it could possibly to do with the
underlying data source but I am unsure.

I am using an MS Access 2003 .ADP project connecting to a SQL Server 2005
database. I have done this in a .MDB file before and it works fine.

--
Thank you




Dirk Goldgar said:
andrew3254 said:
Hiya,

I have several forms which I want to toggle the DataEntry property
according
to a user property. The user property is being looked up and the right
value
is being obtained but when it comes to setting the DataEntry property of
the
form it doesnt seem to be working.

Here is my code:

If isAdmin = True Then
[Forms]![frmSecondments].Form.DataEntry = False
[Forms]![frmSecondments].NavigationButtons = True
Else
[Forms]![frmSecondments].Form.DataEntry = True
[Forms]![frmSecondments].NavigationButtons = False
End If

The navigation buttons are switching ok but the data entry isnt.

Does anyone have any ideas?


It seems to me that it should work, and does in my simple test -- though you
don't need the ".Form" qualifier, nor the brackets (in this case). What
does "not working" mean in this case? I gather you don't gt an error
message, but what exactly do you see that you don't expect to see, or not
see that you expect?

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
A

andrew3254

I found the problem, it was the filter being applied to the form on opening.
As this filter is the same for every form (except this one was missing a
space). It was the missing space that was causing the error, it wasnt
returning the right recordset as thought. Its always the simplest of errors.

Thank you for your time though.
 

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