Conditional entry in a form

G

Guest

I have a yes/no tick box and a data entry field on a form next to each other
(aswell as other entry fields)

When the box yes/no box is ticked ie yes then I want the other entry field
to go a different colour, data not be allowed to be entered into and maybe if
posible skip that field in the tab order
how do I do this? The first 2 bits are the most critical
 
G

Guest

For the first part check help about conditional formatting, also check this
link
http://www.databasedev.co.uk/conditional_formatting.html

Second part
On the AfterUpdate event of the check box write the code to lock or unlock
the field when check box is updated, the Enabled part of the code will skip
the field in the TabOrder

Me.[TextBoxName].Locked = (Nz(Me.[CheckBoxName],False) = True)
Me.[TextBoxName].Enabled = (Nz(Me.[CheckBoxName],False) = False)

If you navigate between records, you need to add the above code to the
OnCurrent event of the form.
 
G

Guest

thanks I will try this today

Ofer Cohen said:
For the first part check help about conditional formatting, also check this
link
http://www.databasedev.co.uk/conditional_formatting.html

Second part
On the AfterUpdate event of the check box write the code to lock or unlock
the field when check box is updated, the Enabled part of the code will skip
the field in the TabOrder

Me.[TextBoxName].Locked = (Nz(Me.[CheckBoxName],False) = True)
Me.[TextBoxName].Enabled = (Nz(Me.[CheckBoxName],False) = False)

If you navigate between records, you need to add the above code to the
OnCurrent event of the form.
--
Good Luck
BS"D


martyn said:
I have a yes/no tick box and a data entry field on a form next to each other
(aswell as other entry fields)

When the box yes/no box is ticked ie yes then I want the other entry field
to go a different colour, data not be allowed to be entered into and maybe if
posible skip that field in the tab order
how do I do this? The first 2 bits are the most critical
 
G

Guest

Mmmm it didnt work, just kept letting me edit the field, one thing I did
notice I could not reset the checkbox back to empty

Ofer Cohen said:
For the first part check help about conditional formatting, also check this
link
http://www.databasedev.co.uk/conditional_formatting.html

Second part
On the AfterUpdate event of the check box write the code to lock or unlock
the field when check box is updated, the Enabled part of the code will skip
the field in the TabOrder

Me.[TextBoxName].Locked = (Nz(Me.[CheckBoxName],False) = True)
Me.[TextBoxName].Enabled = (Nz(Me.[CheckBoxName],False) = False)

If you navigate between records, you need to add the above code to the
OnCurrent event of the form.
--
Good Luck
BS"D


martyn said:
I have a yes/no tick box and a data entry field on a form next to each other
(aswell as other entry fields)

When the box yes/no box is ticked ie yes then I want the other entry field
to go a different colour, data not be allowed to be entered into and maybe if
posible skip that field in the tab order
how do I do this? The first 2 bits are the most critical
 

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