Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Nov 2001
    Location
    Burbank, Illinois, USA
    Posts
    55
    Thanks
    0
    Thanked 0 Times in 0 Posts

    I really need help with forms (XP-SP2)

    I have a form with fields that are combo boxes. If the user enters a vendor name that is not on the list, I have a message that pops up to tell them to add the vendor name to the vendor form. here is the code for both NotInList and OnDblClick:

    Private Sub VendorName_NotInList(NewData As String, Response As Integer)
    MsgBox "Double-click to add vendor to the list."
    Response = acDataErrContinue
    End Sub

    Private Sub VendorName_DblClick(Cancel As Integer)
    On Error GoTo Err_VendorName_DblClick
    Dim lngVendorName As Long

    If IsNull(Me![VendorName]) Then
    Me![VendorName].Text = ""
    Else
    lngVendorName = Me![VendorName]
    Me![VendorName] = Null
    End If
    DoCmd.OpenForm "AddNewVendorName", , , , , acDialog, "GotoNew"
    Me![VendorName].Requery
    If lngVendorName <> 0 Then Me![VendorName] = lngVendorName

    Exit_VendorName_DblClick:
    Exit Sub
    Err_VendorName_DblClick:
    MsgBox Err.Description
    Resume Exit_VendorName_DblClick
    Exit Sub

    End Sub

    This all works fine and dandy except if I enter a po for the same vendor three different times, that name shows on the vendor drop down list three seperate times. I want the name to show only once on the drop down list and not for every ordered entered for this vendor.

    Unfortunately, even after deleting all queries and reports, I am unable to attach my database. The size is still 279kb zipped. I would appreciate any help I can get.

    Thanks
    Wendy

  2. #2
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: I really need help with forms (XP-SP2)

    Wendy
    In the combo which shows the multiple items.
    Go to design view, look for the row source and highlite (click once) that section.
    To the right of the section should show a button with three dots ( ... )
    Click this and you are in query design for that row.
    Use the calc button from the top menu, (Looks like an E backwards) and select "group by".
    Close the query design from the top right X and try your combo again.

    This should now work. (dependant on content of the columns in the query )

  3. #3
    Star Lounger
    Join Date
    Nov 2001
    Location
    Burbank, Illinois, USA
    Posts
    55
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: I really need help with forms (XP-SP2)

    Thank you! Thank you! Thank you! You can't image what a life saver you are! Thank you again!

    Wendy

Posting Permissions

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