Choose Invoice# fills Userform again

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Patrick gave me a great code that allows me to have a user form were the
invoice# is choosen via combo box then the macro uses that invoice number to
fill the text boxes. Price Boxes Purchased etc. Problem arrises because
there can be more than one entry of an invoice number.
eg. 1001
1001
1002
1003
1003
The only thing in the database sheet that may never have duplicates is the
assigned index number. But I really need the user to have the option of
choosing the invoice. The only idea I know of would be to have another column
that concantenates the two (index & invoice) and have them choose that. Does
anyone have any other help? Thank you The following is the code Patrick gave
me.
Private Sub cboInvoice_Change()
RowNumber = cboInvoice.ListIndex + 2
ShowValue cboInvoice
End Sub

Private Sub UserForm_Initialize()

With Worksheets("ProduceData")
LastRow = .Range("b2").End(xlDown).Row
RowNumber = cboInvoice.ListIndex + 2
End With
End Sub
 
Never Mind- I just concantenated them to make a unique invoice number.
Thanks.Jennifer
 
But the code Patrick gave you did not depend on what Invoice number was
chosen. (It would be unclear how the user would differentiate however).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top