Results 1 to 6 of 6
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Problem solved - used instr on control names rather than polling by Tag. Theory: MS doesn't tolerate more than one tag setting for a form, or something equally goofy.

    I have this:

    Code:
    Public Function CheckUserEdits()
        Dim UserCtlString As String
        Dim UserCtl As Control
        Dim ctl As Control
        Dim ContainsNulls As Integer
        
        For i = 0 To 7
            For Each ctl In Forms!RUG.MainTab.Pages(i).Controls
                With ctl
                    If .Tag = "OR" Then
                        If IsNull(.Value) Then
                            ContainsNulls = 1
                            Debug.Print "Control name: " & .Name
                            Debug.Print "Control value: " & .Value
                        End If
                    End If
                End With
            Next
        Next i
    
    End Function
    just debug.print to see if the loop events work. they do. each form control has a smart tag and tag set to OR.

    Now! when i do this:

    Code:
    Public Function CheckUserEdits()
        Dim UserCtlString As String
        Dim UserCtl As Control
        Dim ctl As Control
        Dim ContainsNulls As Integer
        
        For i = 0 To 7
            For Each ctl In Forms!RUG.MainTab.Pages(i).Controls
                With ctl
                    If .Tag = "UE" Then <-- that's the ONLY ONLY ONLY change
                        If IsNull(.Value) Then
                            ContainsNulls = 1
                            Debug.Print "Control name: " & .Name
                            Debug.Print "Control value: " & .Value
                        End If
                    End If
                End With
            Next
        Next i
    
    End Function
    The code fails: "Object does not support this property or method". The control tags are "UE" in Smart Tags and Tags. several controls are drop-downs, but not all. i can't even get a list based on the control tag, and changing UE to something like, say, WTF, doesn't help either.

    So, WTF??

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I've tested your code and I have no problem. Can you post a stripped version of your DB where the error occur ?
    Francois

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Since I implemented a hack to get around this weird problem, I'm moving on to other things. I really shouldn't try to do this sort of work on Friday...

  4. #4
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    Can you clarify what the problem was here?
    Was it that you wanted some controls to have both "UE" and "OR" in their Tag, so they belonged to both groups?
    In that case, yes you would need to use:
    Code:
    If (InStr(1, .Tag, "OR") > 0) Then
    rather than

    Code:
    If .Tag = "OR" Then

    I often use code like this (looping through controls checking for something in their Tag property), so I am just wondering if there is some pitfall here I was not aware of.
    Regards
    John



  5. #5
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by John Hutchison View Post
    Can you clarify what the problem was here?
    Was it that you wanted some controls to have both "UE" and "OR" in their Tag, so they belonged to both groups?
    In that case, yes you would need to use:
    Code:
    If (InStr(1, .Tag, "OR") > 0) Then
    rather than

    Code:
    If .Tag = "OR" Then

    I often use code like this (looping through controls checking for something in their Tag property), so I am just wondering if there is some pitfall here I was not aware of.
    I have a set of controls that are "OR" and another set that are "UE". there's no overlap. some other controls have no tag at all, and the first code block (which polls based on Tag info) does, correctly, ignore controls with no tag data. it's just that if i try to poll UE controls using the Tag technique it mysteriously fails. since i have prepends on those controls, i can still pick them up in a loop but it's a weird thing to have to do...

  6. #6
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    Quote Originally Posted by steve_skelton13 View Post
    it's just that if i try to poll UE controls using the Tag technique it mysteriously fails. Since i have prepends on those controls, i can still pick them up
    There is nothing special about using UE as a tag. The standard code works OK for me with that tag.

    What is a 'prepend"?

    I am puzzled by this thread, and am interested in getting to the bottom of it. But if you are not, and just want to move on, don't bother replying.
    Regards
    John



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •