Listbox wont search for record (1 Viewer)

BJF

Registered User.
Local time
Today, 11:58
Joined
Feb 19, 2010
Messages
137
Hello,

I have a form with Bill To customers with a tab control.
I put a subform on a separate tab for Ship To's that pertain to the Bill To of the main form.
It works fine, and there are multiple Ship To's for each bill to which i see and can scroll through the records fine.

The problem im having is I added a listbox to the subform which is seeing the correct records via criteria in the ACCT field.
However, its not going to the record after i select from the listbox.

The code i have on the macro of the listbox after update event is: ="[Acct] = " & Str(Nz([Screen].[ActiveControl],0))
I dont understand why it wont work as i have another tab with another subform with the same code on a listbox and it finds the records just find on the subform.

Am i missing something?
Thanks,
BJF
 
One possible reason could be that your bound column is not unique?
 
Is your macro actually doing anything other than returning True or False?

Wouldn't you have to pass that expression to the subform's Filter property and set the FilterOn property to True?

I never used macros so can't really advise any further.
 
Are you sure screen.activecontrol is the right control?
 
Hi DBguy,

My listbox is unbound, is that a problem?
Even unbound listboxes must have a bound column, especially if the user must select an item from it, or it would be almost useless. Check the value in its Bound Column property. It cannot contain a null value. What does it say?
 
Even unbound listboxes must have a bound column, especially if the user must select an item from it, or it would be almost useless. Check the value in its Bound Column property. It cannot contain a null value. What does it say?
Hi,
The value is set to 1 , i guess by default, i didnt set that. Is that correct?
 
Hi,
The value is set to 1 , i guess by default, i didnt set that. Is that correct?
Yes, so I suggest you check the values in the first column to verify there aren't any duplicate values.
 
Yes, so I suggest you check the values in the first column to verify there aren't any duplicate values.
ok, let me double check this.
Just to make sure, should the value be set to 0 (not blank but zero) since my 1st query column in the listbox is ACCT?
I know that when referencing the first field it is Column(0).
Thanks
 
ok, let me double check this.
Just to make sure, should the value be set to 0 (not blank but zero) since my 1st query column in the listbox is ACCT?
I know that when referencing the first field it is Column(0).
Thanks
The bound column of 1 refers to the first column whether it's visible or not. I don't think you can have a bound column of 0.
 
If you are selecting from a listbpx, you are never going to get a Null, surely?
 

Users who are viewing this thread

Back
Top Bottom