On my form I have a un bound text box [InvoiceID] and in my List box I
have
all Invoices with the same [InvoiceID] how do I filter InvoiceID as it
will
show the same as my Form Opened
Your message is a bit confusing.
There is more than 1 record with the same InvoiceID? How do you keep
track of them? Perhaps you meant CompanyID or something like that, as
one company can indeed have more than one Invoice.
If the text box [InvoiceID] is unbound, it does not contain any data
until you enter a value AFTER the form opens.
Perhaps you can use the [InvoiceID] control's AfterUpdate event to
fill the List box.
Code the control's AfterUpdate event:
Me.[ListBoxName].Rowsource = "Select TableName.* from TableName Where
TableName.[InvoiceID] = " & Me.[InvoiceID]
The above assumes the [TableID] field in the table is a Number
Datatype.
Change InvoiceID to whatever the actual name of the table field is.
Open the form. Enter the wanted value into the [InvoiceID] control.
The List box will display the appropriate invoice number records
An even better solution would be to use a combo box to select the
wanted invoiceID from. This way only actual numbers will be available,
so no inadvertent wrong numbers will be entered. You can use the Combo
wizard to fill the combo box with the InvoiceID values from the table.