Fields yes/no me.fieldname.enabled=false?

  • Thread starter Thread starter Harmannus
  • Start date Start date
H

Harmannus

Hallo,

I have a check yes/no "invoice" field. If the value is yes i want to
activate the field InvoiceAddress.

Behind which events do i place the various me.address.enabled=false or =true
values?

I tried a lot of combinations but no succes.

The default value of the invoice yes/no field = no

So opening the form should show me.InvoiceAddress.enabled=false but if the
invoice yes/no field is yes it should show me.InvoiceAddress.enabled=true

Unchecking invoice to no should change me.InvoiceAddress.enabled=false

Checking it to yes should chance me.InvoiceAddress.enabled=True

Thanx for any tips!

Regards,

Harmannus
 
In the Click Event of your checkbox: (which I have named chkInvoice)

Me.InvoiceAddress.Enabled = Not Me.chkInvoice

Note that you would want to set Enabled=No at designtime for the
InvoiceAddress field, as this code will not run until the user takes action.
 
Hallo,

Thanx for the tip!

Doesn't realy do the trick ;-(

Already use me.InvoiceAddress.Enabled=False behind the on open Event.

Using your code still means clicking the checkbox to trigger the
me.InvoiceAddress.Enabled=True. Which means the checkbox is unchecked while
the "checked state" implies a diferent Invoice Adress.

Any more suggestions? Do i need a If me.chkInvoice=No then?


Regards,

Harmannus
 
If I understand what your trying to do --- I have one of
my applications where I have set the specific field
property (on the form) to visible = No. Then OnOpen (also
OnCurrent), I do a lookup and based upon the value of the
Y/N field, I Update the field property to visible =
Yes/No.

This has allowed some specific fields to be shown on the
form, but only where a specific criteria is met (Check =
Yes).

Hope that helps

SteveD
-----Original Message-----
Hallo,

I have a check yes/no "invoice" field. If the value is yes i want to
activate the field InvoiceAddress.

Behind which events do i place the various
me.address.enabled=false or =true
values?

I tried a lot of combinations but no succes.

The default value of the invoice yes/no field = no

So opening the form should show
me.InvoiceAddress.enabled=false but if the
 
Hallo Steve,

That sounds ok.

Could you be more specific on the lookup code?

Thanx in advance!


Regards,

Harmannus
 
something like:

If DLookup("Cust_ID", "tblCustomers", "Cust_ID = " &
Me.Combo11.Value & " and Cust_Dealer = True ") Then

Me.DlrName.Visible = true

Else

Me.DlrName.Visible = false
end if

Concept: I want to show the Dealer's Name if that customer
is associated with a dealer. On the form, the customer ID
is from a combo box (combo11) and the criteria is the
Cust_Dealer (a Yes/No box).

You could probably also do the same concept to a data
element that is part of the record source of your form,
but may not be shown.

something like:

if Me.CheckYN = Yes then
Me.Address.Visible = Yes
Else
Me.Address.Visible = No
End If

Hopefully, you get the idea, I will continue to help if
needed.

SteveD
 
Hallo Steve!

Thanx for the code!

I will give it a try.

Thanx a lot.


Regards,

Harmannus
 
Back
Top