Ksabai

Ksabai

Registered User.
Local time
Today, 10:31
Joined
Jul 31, 2017
Messages
104
Hello Everyone,

I'm an novice to ms access. I have tables contract and payments. In Form Payments iam trying to call a condition from contract table to enable or disable the field. my code looks like this but not working:

Private Sub Form_Current()
If (Me.[Contract].[Payment Terms] = "Cash") Then
Me.CADAdvValue.Enabled = False
Me.CADAdvDate.Enabled = False
Else
Me.CADAdvValue.Enabled = True
Me.CADAdvDate.Enabled = True
End If

I get the error unable find field. pls help.
 
You use the form control not the table fields, so something along the lines of
Me.paymentControl or whatever you have called it.

HTH
 
Can u please advice a code for me. iam unable to figure out a code.
 
Tried as follows, does not work

If Me.Contract.Payment Terms = "Cash" Then
 
Iam getting the error saying that table tblcontract cannot be found. i tried as follows

Me.Contract.Payment_Terms.Value = "Cash"
 
You need to look to see what the contral name is.
If you built the form from the table and the table is Contract and the field is Payment_Terms then it would be

Me.Payment_Terms = "Cash"

HTH
 
Gasman, this works if Payment_Terms is in same Table as the form. here the Payment_Terms is in the Table.Contract and the Form Record.Source is from Table Payment.

Iam trying to get the detail from an other table

REgards
 

Users who are viewing this thread

Back
Top Bottom