Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2008
    Posts
    150

    Unanswered: Need to add new record regardless of multiple records with same field name.

    Hello,

    I have the code below attached to a combo box (wonumber) in the AfterUpdate event, which automatically populates the 4 fields when the wonumber is entered into the combo box (wonumber). This is actually working really well when it is a new work order number entered. But, when there are multiple entries with the same work order numbers in the table, it does not go to a new record; it pulls-up the first work order number (record) in the table.

    How can I enter a work order number to a new record regardless of multiple entries with the same number? I do have the "Data Entry" set to "Yes" in the properties. Thank you so much in advance. :-)

    <Begin Code>
    Private Sub cboWONumber_AfterUpdate()

    Me.WONum_txt.Value = Me.cboWONumber.Column(0)
    Me.PCNum_txt.Value = Me.cboWONumber.Column(1)
    Me.PCName_txt.Value = Me.cboWONumber.Column(2)
    Me.ProjectMgr_txt.Value = Me.cboWONumber.Column(3)

    If IsNull(Me.cboWONumber) Then
    Me.FilterOn = False
    Else
    Me.Filter = "WO_Number = """ & Me.cboWONumber & """"
    Me.FilterOn = True
    End If

    End Sub
    <End Code>

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    after setting the filter

    Code:
    Me.FilterOn = True
    me.movelast 'may not be needed
    me.addnew
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Sep 2008
    Posts
    150
    Quote Originally Posted by healdem View Post
    after setting the filter

    Code:
    Me.FilterOn = True
    me.movelast 'may not be needed
    me.addnew
    Thank you healdem for coming to my aid again. It is working great. :-)

Posting Permissions

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