J
Jack G
I'm trying to control which of two tabs will be visible in a form depending
on the first letter of the current record's "ProjectNumber". If the fist
letter of ProjectNumber is "U", a tab named "Details-USA" will be visible,
but "Details-Europe" will not be visible; if the first letter is "E", a tab
named "Details-Europe" would be visible, but "Details-USA" wouldn't.
I tried to define a function called DetailsTab to do this and then have the
function called from the "On Current" event of my form, but it has never
worked. One of my many failed attempts at the code looked something like
this:
Function DetailsTab()
If Mid(Forms!DetailsForm!ProjectNumber, 1, 1) = "U" Then _
Forms!DetailsForm!Details-USA.Visible = True
Forms!DetailsForm!Details-Europe.Visible = False
If Mid(Forms!DetailsForm!ProjectNumber, 1, 1) = "E" Then _
Forms!DetailsForm!Details-Europe.Visible = True
Forms!DetailsForm!Details-USA.Visible = False
End Function
I'd appreciate any direction someone could give me on this, including
changing direction altogether. It seems like this ought to be pretty
simple!
Jack
on the first letter of the current record's "ProjectNumber". If the fist
letter of ProjectNumber is "U", a tab named "Details-USA" will be visible,
but "Details-Europe" will not be visible; if the first letter is "E", a tab
named "Details-Europe" would be visible, but "Details-USA" wouldn't.
I tried to define a function called DetailsTab to do this and then have the
function called from the "On Current" event of my form, but it has never
worked. One of my many failed attempts at the code looked something like
this:
Function DetailsTab()
If Mid(Forms!DetailsForm!ProjectNumber, 1, 1) = "U" Then _
Forms!DetailsForm!Details-USA.Visible = True
Forms!DetailsForm!Details-Europe.Visible = False
If Mid(Forms!DetailsForm!ProjectNumber, 1, 1) = "E" Then _
Forms!DetailsForm!Details-Europe.Visible = True
Forms!DetailsForm!Details-USA.Visible = False
End Function
I'd appreciate any direction someone could give me on this, including
changing direction altogether. It seems like this ought to be pretty
simple!
Jack