473,508 Members | 2,263 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Am I crazy or just not doing this right?

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
5 1392
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
3321
by: doltharz | last post by:
Please Help me i'm doing something i though was to be REALLY EASY but it drives me crazy The complete code is at the end of the email (i mean newsgroup article), i always use Option...
10
2000
by: John Croson | last post by:
I have two pages that are marked up identically, but don't want to display that way. The correct page: http://www.ramart.org/05_visit_ram/hours.php <p>Charges for tours include the following...
1
4733
by: trialanderror | last post by:
I've been happily chugging along thinking I understood floating divs and now find that I know a lot less than I thought I did. And the more I try "fixing" things, the worse it gets. A lot of what...
12
2662
by: Gnolen | last post by:
Hi, I am really getting crazy here! I just do not get why this happens with the borders of the td/tr! I just want a border on the bottom of the rows(or td) but I just can't do it!!! I have tried...
19
1688
by: Daniel Billingsley | last post by:
I think it's really nice to be able to do code like someVariable = someMethod(new SomeClass("some text")); However, as method signatures are number and types of parameters, you're limited to...
1
982
by: Zack | last post by:
I am writing an app using FileSystemWatcher and just went a little class crazy. I have the following classes Server MasterServer inherits server SlaveServer inherits server SiblingServer...
0
2270
by: Aws | last post by:
My crazy GridView !! I am using Visual Studio 2005, I have a problem with my GridView. I have one access .mdb table and when I update a record on the table EVERYTHING is perfect. I made a Web...
2
3616
by: kheitmann | last post by:
OK, so I have a blog. I downloaded the "theme" from somewhere and have edited a few areas to suit my needs. There are different font themes within the page theme. Long story short, my "Text Posts"...
1
1367
by: DaMasta | last post by:
hi..im new to the community and was finally so fustrated with guessing that i figured i'd try to get some help (and from my writing..you can probably tell im not exactly 40 years old) oki..here's...
0
7231
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7132
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7401
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7504
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5640
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4720
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3196
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1568
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
432
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.