Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need check box auto fill another field or visa versa 1

Status
Not open for further replies.

Dawnit

Technical User
Apr 2, 2001
76
US
My Table has one field with various text codes and a separate field with a check box. If the first field has a record where the value is "P" I want the check box to automatically check itself.

Or, If I check the check box for a specific record, I want the other field to fill in the value "P"

Can this be done with MS Access 2000?

Thanks!
 
you could use the OnCurrent event of the form to set the value of the checkbox to -1 if the value of the field is 'P'

this could be done with a formula or VB, depending on your preference.

IIF([fieldname] ='p', [checkboxname] = -1)

or VB

If [fieldname] = 'p' then
me.[checkboxname] = -1
end if

for the second situation, you could just do the reverse, and put it in the AfterUpdate event


Brian Famous
bfamous@ncdoi.net

 
yes use the AfterUpdate Event for the textbox and the checkbox

ex:

Private Sub TextBoxName_AfterUpdate()
if TextBoxName = "P" then
CheckBoxName = True
Else
CheckBoxName = False
End If
End Sub

Private Sub CheckBoxName_AfterUpdate()
If CheckBoxName = True Then
TextBoxName ="P"
Else
'Do Something Else
End If


PaulF
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top