To start with sorry about all the bold formatting, work computer won't run scripts. All I can say is I need to read many more books on VBA! Your code does the job perfect. But if I may, can I pick your thoughts on it? I can follow it thru to ctrl.Visible = (Me.Gender = "Female"). Is this stating...
PHV, Do you mean something like below or am I missing the obvious. That does do what I want. But I was thinking that there would be a shorter way to the goal.
Private Sub Form_Current()
Dim ctrl As control
[Implants]![Patient_ID].SetFocus
If Me.Gender = "Male" Then
For Each ctrl In...
Andy,
I have. I should of put down that I want to reference the 2 different controls at the same time using the
(for each ctrl in)on the same line. like For Each ctrl In [Form1].Controls, [Form2].Controls. Not sure how to do that or if it's possible. Should I continue to pursue this approach or...
some more guidance in reference to this thread. Is it possible to reference two different sub form controls on the (For Each ctrl In) line? Not even sure how to start this. Or if I need to go to a different method.
Private Sub Form_Current()
Dim ctrl As control
If Me.Gender = "Male" Then...
That work good also PHV, aside from checking my spelling that is. Thanks for the good tip I will be sure to use it. But now I found another bug. If my last click or focus was on one of the controls it errors with the (you can't hide a control that has focus) [mad]
OK, this is what I found out. Case sensitive to the word in the tag. Live and learn eh!
This is what I ended up with and works perfect. BTW still reading the book on debugging. I'm missing something on that point. I don't suppose it's to difficult but I'm learning.
Private Sub Implants_Enter()...
Little back ground. I have a main form [Patient] and on that form is a [tabctl] and on a tab is the subform [implants]. what I have been trying to accomplish is to hide a set of controls that are tagged with the word femalegrp. I can get this to work on the main form.
Private Sub sex_Change()...
dhookom
About what I said on the previous post I was wrong. It does display the "is not null" only. Sorry don't know what I done to get it wrong on the first try. And it even works when filtered. man do I feel dumb now![blush] Thanks to the both of you for everything. I'm still gonna keep...
Sry for the delay gents. The value of the Me.filter is as follows.
[Daily Exam Log]![Date_DailyExamLog]=[Enter date mm/dd/yyyy]
and
[Daily Exam Log]![Date_DailyExamLog]=Date()
Filter is changed with command button entry.
PHV I tried the LabelAcnt.Caption = DCount("[accession number]"...
That gives me a Null or zero return, but no errors. The same return as
LabelAcnt.Caption = DCount("[accession number]", "[daily exam log]", "[accession number] ='" & Me.Filter & "'")
does. Good thought though. Thanks.
Sry guys. can't get the 3rd parameter to do it either. Tried,
LabelAcnt.Caption = DCount("[accession number]", "[daily exam log]", "[accession number] ='" & Me.Filter & "'")
to try and filter off the current form but no go. I just don't think it's possible to apply a Dcount to a form that is...
Thanks to both of you. I could not get the Dlookup to do what I needed randy. probably due to lack of know how. But I looked further into the Dcount and was able to apply it with
DCount("[accession number]", "daily exam log")
, but still can not have it only count the current filtered...
Is it possible to have a label caption display the number of records on a form to where you can count the records based on a field not being empty or it's null or not null values?
I can't figure this one out. I can do the
Private Sub Form_Current()
LblCount.Caption = (Recordset.RecordCount)...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.