Same subform in different parent forms - does this cause issues

S

Saeed

Consider the following with Access 2000:

1. FormA has SUbFormB as a sub form
2. FormC also has SubFormB as a sub form
3. A search form FormD allows the user to search records, and the user
then clicks for either FormA or FormC, passing in the appropriate ID so
that the form displays the correct data.
4. FormC was created as a copy of FormA and then amended to work
slightly differently.

The problem is that when the user clicks for FormA, the ID does not
appear to be getting passed to FormA. But when the user clicks for FormC
it works fine. Debugging the on click event for both buttons shows that
the value of ID is set correctly, but the Form_Load event of FormA
showed the ID as null. Prior to the creation of FormC this worked fine
for FormA.

I do have code in the Form_Load event of the sub form which detects what
the parent form is makes a button visible/invisible depending.

The code looks fine, and I am wondering if this anything to do with the
subform in each called form being the same one.



Saeed

ng_786
 
A

Allen Browne

Nothing wrong with your logic.

Turn off Name AutoCorrect, decompile, and then compact.

1. Uncheck the boxes under:
Tools | Options | General | Name AutoCorrect
Explanation of why:
http://allenbrowne.com/bug-03.html

2. Compact the database to get rid of this junk:
Tools | Database Utilities | Compact

3. Close Access. Make a backup copy of the file. Decompile the database by
entering something like this at the command prompt while Access is not
running. It is all one line, and include the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"
 
S

Saeed

Thanks for the suggestion Allen, but it didn't do the trick. I ending up
rebuilding the form from scratch.
 

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

Top