By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,294 Members | 2,645 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,294 IT Pros & Developers. It's quick & easy.

Programming Access Reports with VBA

P: n/a
I have a fairly simple task, or at least I think it should be. I have
a report with two fields on it,

BadgeIn (text)
BadgeOut (text)
chkIncorrect (yes/no)

I want to check if these values are equal and if they are not, update
an outbound checkbox to true. When I try to code the report on the on
open, nothing works. Which event should I be putting my code in? The
below code is what I have.

if BadgeIn <BadgeOut then
chkIncorrect.value = true
else
chkIncorrect.value = false
end if
I have also tried

if BadgeIn.value <BadgeOut.value then
chkIncorrect.value = true
else
chkIncorrect.value = false
end if

Any thoughts?

Dave

Jan 3 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
st********@hotmail.com wrote:
I have a fairly simple task, or at least I think it should be. I have
a report with two fields on it,

BadgeIn (text)
BadgeOut (text)
chkIncorrect (yes/no)
Um, that's three fields :-)
I want to check if these values are equal and if they are not, update
an outbound checkbox to true.
Not sure wht you mean by "outbound checkbox". Did you mean an "Unbound"
checkbox? And is that the third field mentioned above?
When I try to code the report on the on
open, nothing works. Which event should I be putting my code in? The
below code is what I have.

if BadgeIn <BadgeOut then
chkIncorrect.value = true
else
chkIncorrect.value = false
end if
I have also tried

if BadgeIn.value <BadgeOut.value then
chkIncorrect.value = true
else
chkIncorrect.value = false
end if
No code needed. Just use a CheckBox with a ControlSource expression of...

=(BadgeIn = BadgeOut)

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Jan 3 '07 #2

P: n/a
OutBound :-) I ment unbound.

Setting the control source to =([BadgeIn] <[BadgeOut]) did the trick.

Thanks!

Dave
Rick Brandt wrote:
st********@hotmail.com wrote:
I have a fairly simple task, or at least I think it should be. I have
a report with two fields on it,

BadgeIn (text)
BadgeOut (text)
chkIncorrect (yes/no)

Um, that's three fields :-)
I want to check if these values are equal and if they are not, update
an outbound checkbox to true.

Not sure wht you mean by "outbound checkbox". Did you mean an "Unbound"
checkbox? And is that the third field mentioned above?
When I try to code the report on the on
open, nothing works. Which event should I be putting my code in? The
below code is what I have.

if BadgeIn <BadgeOut then
chkIncorrect.value = true
else
chkIncorrect.value = false
end if
I have also tried

if BadgeIn.value <BadgeOut.value then
chkIncorrect.value = true
else
chkIncorrect.value = false
end if

No code needed. Just use a CheckBox with a ControlSource expression of...

=(BadgeIn = BadgeOut)

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Jan 3 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.