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

Am I crazy or just not doing this right?

P: n/a
I'm trying to use the Current event in a simple MS Access 2000 form.
I'd like to conditionally display a field if another boolean-typed
field is set to True/Yes.
That is, if I navigate to a record where the value of the test field
is set to True, the code in my Current event should make two other
controls appear (.Visible=True). Otherwise, keep the controls hidden
(.Visible=False)

What seems to happen is that the code I write in the Current event is
one-off; when I'm on a record where the test field is True, the
controls are still hidden. When I navigate to the NEXT record, the
controls show up even though the value for the test field is False.

Argh?! What am I missing?
Nov 13 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Post your VBA code and let's see.....

--

Ken Snell
<MS ACCESS MVP>

"Shannon Harvey" <sh************@rogers.com> wrote in message
news:fb*************************@posting.google.co m...
I'm trying to use the Current event in a simple MS Access 2000 form.
I'd like to conditionally display a field if another boolean-typed
field is set to True/Yes.
That is, if I navigate to a record where the value of the test field
is set to True, the code in my Current event should make two other
controls appear (.Visible=True). Otherwise, keep the controls hidden
(.Visible=False)

What seems to happen is that the code I write in the Current event is
one-off; when I'm on a record where the test field is True, the
controls are still hidden. When I navigate to the NEXT record, the
controls show up even though the value for the test field is False.

Argh?! What am I missing?

Nov 13 '05 #2

P: n/a
Here's the event code

Private Sub Form_Current()
If Me.Recordset("CheckoutStatus") = True Then
lblCheckinDate.Visible = True
txtCheckinDate.Visible = True
Else
lblCheckinDate.Visible = False
txtCheckinDate.Visible = False
End If
End Sub

Not even close to rocket science.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #3

P: n/a
Shannon Harvey wrote:
Here's the event code

Private Sub Form_Current()
If Me.Recordset("CheckoutStatus") = True Then
lblCheckinDate.Visible = True
txtCheckinDate.Visible = True
Else
lblCheckinDate.Visible = False
txtCheckinDate.Visible = False
End If
End Sub


Private Sub Form_Current()
txtcheckindate.visible=me!checkoutstatus
end sub

will do

Usually, the label is bound to the textbox, and will display/hide along
with its parent. If that is not the case, you can cut the label, select
the textbox, and paste (all in design view)

--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
I prefer human mail above automated so in my address
replace the queue with a tea
Nov 13 '05 #4

P: n/a
Okay, now I'm *sure* I'm going mad. The one-liner works properly, and
it's (as far as I can tell), functionally equivalent to my original
code. What gives?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #5

P: n/a
Shannon Harvey wrote:
Okay, now I'm *sure* I'm going mad. The one-liner works properly, and
it's (as far as I can tell), functionally equivalent to my original
code. What gives?


Your original code states

me.recordset

and even if that is .recordsetclone in the real code, that is wrong.
RecordsetClone will be a clone of the recordset in the form, all right,
but not on the same record--on the first.

--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
I prefer human mail above automated so in my address
replace the queue with a tea
Nov 13 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.