Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

user defined function incorrectly running on form open 1

Status
Not open for further replies.

sub5

Programmer
Oct 12, 2005
104
Hi all,
I get error 3021 no current record when I open a form which has listbox whose row source property is refering to to a user defined function which moves through the records in a query to populate the list box.

There is nothing in the listbox row source.

The function is a private function in the form's module.

I know there is no current record because I need to create some before I get to the list box. I am not querying the list box in any procedures relating to opening the form.

Why does it jump to my user defined function on form open?
What do I do to stop it running that procedure until I want it too ie until I have created the data? (I have tried disabling the listbox until I want it but that failed)
 
Why not, that's where it gets the rows from.
put something like:


if nz(.recordcount,0) > 0 then
do some stuff
call the function etc
populate the list box
else
do something else or nothing
endif

Troyston

Troy Vinson
Trading as IT Supportman
 
That did it, cheers Troy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top