Item_Open

  • Thread starter Thread starter Arlene Swedberg
  • Start date Start date
A

Arlene Swedberg

I have a form that I created in which I populate certain
fields using the possible values method. The form works
fine, but I would like to have it populate fields by
connecting to an MS Access database instead. I started
working in a separate form to get this part working and
now I need to add this additional code to my existing form.

Is there a limit to how much code you can have in an
Item_Open procedure, or does the code have to be in a
particular order? When I add this additional code to my
form to make the database connection, etc., it only works
if I place it before my existing code, which then stops
functioning. When I reverse everything and add the code
that opens the database connection etc. to the end of my
Item_Open procedure, my original code works and the
database connection statements no longer work.

Should I be keeping the code for the database connection
etc. in another procedure and calling it from the
Item_Open procedure? I'm not sure what to do and would
appreciate any help with this.

Arlene
 
-----Original Message-----
Can you define "no longer works"?

Do the existing code and your new code use the same variables for different
things?

Do you have something like "Exit Function" in either one?

I'd put in some Debug.Write's and/or MsgBox's to track through it. Or, put a
Stop at the beginning of the code and step through it.

You shouldn't HAVE to, but putting the new code in a separate function/sub
may help out. For example, this would limit the scope of the variables.

-jcf




.
Thank you much. I went back in and looked at my
variables again. After I had pieced the two parts
together I had used a couple of variables more than once
for different things. I appreciate your help. I wasn't
sure if I was just trying to do too much with the
Item_Open procedure.

Arlene
 
Back
Top