Doesn't recognize combo box?

pbuethe

Returning User
Local time
Yesterday, 23:32
Joined
Apr 9, 2002
Messages
210
I have a main form with a tab control. On the first page of the tab control I have a combo box, ElimCode. I want to show or hide 2 controls on the second page, Criteria_Met and On_Therapy, depending on whether ElimCode is null. (The controls should be shown if ElimCode is null, and hidden if it is not null.) I put the following code in the OnCurrent property of the form:

If Me![ElimCode] = Null Then
Me!Criteria_Met.Visible = True
Me!On_Therapy.Visible = True
Else
Me!Comments.SetFocus
Me!Criteria_Met.Visible = False
Me!On_Therapy.Visible = False
End If

The result is that the two controls are *always* disabled. The same thing happens if I change it to Forms!frmMain![ElimCode].
It seems to not be recognizing ElimCode somehow.

Would appreciate any help in getting this to work.
 
Almost certain that Access can't see the field from another page, add the field to the main part of the tab ctrl, rename it to something like txtCode, hide it, your code should look something like
If IsNull(Me.txtCode) Then
Me!Criteria_Met.Visible = True
Me!On_Therapy.Visible = True
Else
Me!Comments.SetFocus
Me!Criteria_Met.Visible = False
Me!On_Therapy.Visible = False
End If
 
Thanks Rich! All I needed was to change it to IsNull(Me![ElimCode]) and it worked. The only problem is, now when the form is first opened, the tabs have scrolled out of view. Any ideas?
 
Sorry Pat, resizing didn't work. However I have managed to fix that problem in that the tabs now will show when the form is first opened, however I am still getting a message "can't find the macro '.'" I do not have a macro '.' that I know of. How can I get rid of this message?
 
Could not see any stray periods in the events. Also, I'm not sure how to debug. Can you explain how to put a break on the statement and single step through the loading of the form?
 

Users who are viewing this thread

Back
Top Bottom