If is Visble Then Control is True

D

Dave Elliott

If Me.Lbl383.Visible = Nz(Me.Text362, 0) = 0
In other words if Lbl383 is visible then (CheckBox) Due value will be True
control source set to Due
The control is a True/False check box with its default being set to False
Control name is Due
 
N

Nikos Yannacopoulos

Dave,

Try:

If Me.Lbl383.Visible = True Then Me.Due = True

or

Me.Due = Me.Lbl383.Visible

The difference between the two is that the former will set Due if the label
is visible and do nothing if not, whereas the latter will always set/reset
Due according to whether the label is visible or not.

HTH,
Nikos
 
N

Nikos Yannacopoulos

Dave,

Just saw your other post. Is it the same case? If yes I was answering the
wrong question, I thought you were trying to set the value of anothe control
on the same form here.

Nikos
 
D

Dave Elliott

This does work and changes the check box to true, but it also makes the form
go into an edit mode with the pencil and thefore not saved.
Any suggestions?
 
N

Nikos Yannacopoulos

Dave,

So this is what you wanted, but you also want the record saved immediately?
In this case just add this line of code right after the previous one:

DoCcmd.RunCommand acCmdSaveRecord

HTH,
Nikos
 

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