Easy Question About Forms

  • Thread starter Thread starter wessleym
  • Start date Start date
W

wessleym

I have two easy questions about forms:

1. How can I make a checkbox on a form that will disable
a field on the same form?

2. How can I make the value of field A equal to field B
after field B has lost focus?

Thank you.
 
wessleym said:
I have two easy questions about forms:

1. How can I make a checkbox on a form that will disable
a field on the same form?

In the checkbox after upate event, you can go:

me!MyFieldContorlName.Enabled = me!MyCheckBox
2. How can I make the value of field A equal to field B
after field B has lost focus?

In the fields b after update event, you go:

me!FieldA = me!FieldB
 
In both cases, I get an error about an unrecognized macro:

1. I entered
me![End Date]=me![Start Date]
for After Update and got the error message
Microsoft Access can't find the macro 'me![End Date]=me!
Start Date.'
For whatever reason, brackets don't show up around Start
Date in the error message.

2. I entered
me!Time.Enabled=me![Filter Time]
for After Update and got the erro message
Microsoft Access can't find the macro 'me!Time.'

What's going on here?
 
Ok, the examples I gave require you to use the VB code editor to enter the
code expressions I used.

So, for the setting of the field value, you do the following:

Bringing up the startDate control on your form (in design mode). View the
properties sheet for this control.

Select the Event tab, and then click in the After update event. (if you
entering something in this property from before...just .erase it). now,
click on the button that appears to the far right (the thing with 3 dots, it
kind of looks like [...]).

You now get 3 choices. We will choose the 3rd option (code builder).

Now, you can enter:

me![End Date]=me![Start Date]

Close the code editor, and now save your screen.

The same idea will be used for the check box. You again use the above steps
to choose the code builder.

You in this case can use:

me!Time.Enabled=me!MyCheckBox
 
Thank you! That worked perfectly! I have one more
question, although its unrelated. I created a button in
a wizard that is supposed to print the report "Labels."
Once clicked, it seems to quickly process something, a
printer icon appears in the notification area, but then
it says "The OpenReport action was canceled." What does
that mean?
 
Back
Top