Page 3 of 3 FirstFirst 123
Results 31 to 38 of 38
  1. #31
    New Lounger
    Join Date
    Jan 2018
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Strange! I'll try using Chrome and see if that will upload.

  2. #32
    New Lounger
    Join Date
    Jan 2018
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Capture.JPG

    Just the same with Chrome as well, maybe an issue with my ISP? I had an idea though, as it lets me upload an image, I've attached a snap shot of how the modules look in my VB editor. Does that help?

  3. #33
    Super Moderator macropod's Avatar
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,299
    Thanks
    2
    Thanked 487 Times in 397 Posts
    Your screenshot is of no particular help.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  4. #34
    New Lounger
    Join Date
    Jan 2018
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for your assistance and patience! Without me being able to upload my file, I don't think we can go any further with this. I may try another route of using a user form to do what I want to. I've done this before in Excel and in having a look, it seems similar in Word so I may be able to do it that way.

  5. #35
    WS Lounge VIP access-mdb's Avatar
    Join Date
    Dec 2009
    Location
    Oxfordshire, UK
    Posts
    2,144
    Thanks
    177
    Thanked 205 Times in 197 Posts
    slmgr.txt

    You could use the insert image button and attach the file - it seems to work when I attached the above text file.
    If I save the whales where do I keep them?

  6. #36
    New Lounger
    Join Date
    Jan 2018
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok, though I have found some code that almost does what I wan it to, I have pasted it below. The AonEnty and AonExit code works fine for text fields. The AonEntry2 and AonExit2 code is not quite working for the dropdown fields. Can you tell How to modify the code for it to work with dropdown fields?

    Option Explicit
    Private mstrFF As String
    Public Sub AOnExit()
    With GetCurrentFF
    If Len(.Result) = 0 Then
    MsgBox "You can't leave field: " & .Name & " blank"
    mstrFF = GetCurrentFF.Name
    End If
    End With
    End Sub
    Public Sub AOnEntry()
    Dim strCurrentFF As String
    If LenB(mstrFF) > 0 Then
    ActiveDocument.FormFields(mstrFF).Select
    mstrFF = vbNullString
    End If
    End Sub
    Public Sub AOnExit2()
    With GetCurrentFF
    If Len(.Result) > 0 Then
    MsgBox "You can't leave field: " & .Name & " blank"
    mstrFF = GetCurrentFF.Name
    End If
    End With
    End Sub

    Public Sub AOnEntry2()
    Dim strCurrentFF As String
    If LenB(mstrFF) > 0 Then
    ActiveDocument.FormFields(mstrFF).Select
    mstrFF = vbNullString
    End If
    End Sub
    Private Function GetCurrentFF() As Word.FormField
    With Selection
    If .FormFields.Count = 1 Then
    ' CheckBox or DropDown
    Set GetCurrentFF = .FormFields(1)
    ElseIf .FormFields.Count = 0 And .Bookmarks.Count > 0 Then
    Set GetCurrentFF = ActiveDocument.FormFields(.Bookmarks(.Bookmarks.Co unt).Name)
    End If
    End With
    End Function

  7. #37
    New Lounger
    Join Date
    Jan 2018
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It seems to be just the 3rd line of this part of the code that is not working:

    Public Sub AOnExit2()
    With GetCurrentFF
    If Len(.Result) > 0 Then
    MsgBox "You can't leave field: " & .Name & " blank"
    mstrFF = GetCurrentFF.Name
    End If
    End With
    End Sub

    That part of the code works with a text field, so with a dropdown selection I'm guessing that I need a way to specify the default selection in the dropdown field?

  8. #38
    New Lounger
    Join Date
    Jan 2018
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This is now sorted.

Page 3 of 3 FirstFirst 123

Posting Permissions

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